blob: f50a96e5c70f973a5866d6baa654d89b7468e2ac [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 Frysinger7642f772013-11-01 17:31:58 -04005OUT = $(CURDIR)
6$(shell mkdir -p $(OUT))
Bill Richardson75fcf622010-03-16 13:05:12 -07007
Mike Frysinger7642f772013-11-01 17:31:58 -04008all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0
9
10$(OUT)/rootdev: rootdev.c main.c
Will Drewry80fbc6c2010-08-30 10:13:34 -050011 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -O2 -Wall
12
Mike Frysinger7642f772013-11-01 17:31:58 -040013$(OUT)/librootdev.so.1.0: rootdev.c
Will Drewry80fbc6c2010-08-30 10:13:34 -050014 $(CC) $(CFLAGS) $(LDFLAGS) -shared -fPIC \
Mike Frysinger7642f772013-11-01 17:31:58 -040015 -Wl,-soname,librootdev.so.1 $< -o $@
16 ln -s $(@F) $(OUT)/librootdev.so.1
17 ln -s $(@F) $(OUT)/librootdev.so
Will Drewry80fbc6c2010-08-30 10:13:34 -050018
19clean:
Mike Frysinger7642f772013-11-01 17:31:58 -040020 rm -f $(OUT)/rootdev $(OUT)/librootdev.so*
Will Drewry80fbc6c2010-08-30 10:13:34 -050021
22.PHONY: clean