Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 1 | # 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 Richardson | 75fcf62 | 2010-03-16 13:05:12 -0700 | [diff] [blame] | 4 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame^] | 5 | OUT = $(CURDIR) |
| 6 | $(shell mkdir -p $(OUT)) |
Bill Richardson | 75fcf62 | 2010-03-16 13:05:12 -0700 | [diff] [blame] | 7 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame^] | 8 | all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0 |
| 9 | |
| 10 | $(OUT)/rootdev: rootdev.c main.c |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 11 | $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -O2 -Wall |
| 12 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame^] | 13 | $(OUT)/librootdev.so.1.0: rootdev.c |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 14 | $(CC) $(CFLAGS) $(LDFLAGS) -shared -fPIC \ |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame^] | 15 | -Wl,-soname,librootdev.so.1 $< -o $@ |
| 16 | ln -s $(@F) $(OUT)/librootdev.so.1 |
| 17 | ln -s $(@F) $(OUT)/librootdev.so |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 18 | |
| 19 | clean: |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame^] | 20 | rm -f $(OUT)/rootdev $(OUT)/librootdev.so* |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 21 | |
| 22 | .PHONY: clean |