Dan Ehrenberg | 5d7d7ff | 2015-03-04 16:00:24 -0800 | [diff] [blame] | 1 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 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 | 515197d | 2013-11-01 17:32:42 -0400 | [diff] [blame] | 5 | CFLAGS += -Wall -Werror |
Dan Ehrenberg | 5d7d7ff | 2015-03-04 16:00:24 -0800 | [diff] [blame] | 6 | |
| 7 | # Support large files and major:minor numbers |
| 8 | CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
| 9 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame] | 10 | OUT = $(CURDIR) |
| 11 | $(shell mkdir -p $(OUT)) |
Bill Richardson | 75fcf62 | 2010-03-16 13:05:12 -0700 | [diff] [blame] | 12 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame] | 13 | all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0 |
| 14 | |
Mike Frysinger | cc7424d | 2013-11-01 17:35:24 -0400 | [diff] [blame] | 15 | $(OUT)/rootdev: main.c $(OUT)/librootdev.so.1.0 |
Mike Frysinger | 515197d | 2013-11-01 17:32:42 -0400 | [diff] [blame] | 16 | $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 17 | |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame] | 18 | $(OUT)/librootdev.so.1.0: rootdev.c |
Mike Frysinger | 515197d | 2013-11-01 17:32:42 -0400 | [diff] [blame] | 19 | $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC \ |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame] | 20 | -Wl,-soname,librootdev.so.1 $< -o $@ |
| 21 | ln -s $(@F) $(OUT)/librootdev.so.1 |
| 22 | ln -s $(@F) $(OUT)/librootdev.so |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 23 | |
| 24 | clean: |
Mike Frysinger | 7642f77 | 2013-11-01 17:31:58 -0400 | [diff] [blame] | 25 | rm -f $(OUT)/rootdev $(OUT)/librootdev.so* |
Will Drewry | 80fbc6c | 2010-08-30 10:13:34 -0500 | [diff] [blame] | 26 | |
| 27 | .PHONY: clean |