blob: 1575f3a35a6b796e94e7e073f9bf691ecf1c98dc [file] [log] [blame]
Will Drewry80fbc6c2010-08-30 10:13:34 -05001# Copyright (C) 2010 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Bill Richardson75fcf622010-03-16 13:05:12 -07004
Mike Frysinger515197d2013-11-01 17:32:42 -04005CFLAGS += -Wall -Werror
Mike Frysinger7642f772013-11-01 17:31:58 -04006OUT = $(CURDIR)
7$(shell mkdir -p $(OUT))
Bill Richardson75fcf622010-03-16 13:05:12 -07008
Mike Frysinger7642f772013-11-01 17:31:58 -04009all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0
10
Mike Frysingercc7424d2013-11-01 17:35:24 -040011$(OUT)/rootdev: main.c $(OUT)/librootdev.so.1.0
Mike Frysinger515197d2013-11-01 17:32:42 -040012 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
Will Drewry80fbc6c2010-08-30 10:13:34 -050013
Mike Frysinger7642f772013-11-01 17:31:58 -040014$(OUT)/librootdev.so.1.0: rootdev.c
Mike Frysinger515197d2013-11-01 17:32:42 -040015 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC \
Mike Frysinger7642f772013-11-01 17:31:58 -040016 -Wl,-soname,librootdev.so.1 $< -o $@
17 ln -s $(@F) $(OUT)/librootdev.so.1
18 ln -s $(@F) $(OUT)/librootdev.so
Will Drewry80fbc6c2010-08-30 10:13:34 -050019
20clean:
Mike Frysinger7642f772013-11-01 17:31:58 -040021 rm -f $(OUT)/rootdev $(OUT)/librootdev.so*
Will Drewry80fbc6c2010-08-30 10:13:34 -050022
23.PHONY: clean