| 1 |
CFLAGS = -W -Wall |
| 2 |
|
| 3 |
ifdef DEBUG |
| 4 |
CFLAGS += -g3 |
| 5 |
endif |
| 6 |
|
| 7 |
STRIP = strip |
| 8 |
|
| 9 |
all: find-partitions mkfstab mountpoint |
| 10 |
|
| 11 |
find-partitions: partconf.h find-parts.c util.o xasprintf.o |
| 12 |
$(CC) $(CFLAGS) -o $@ -DFIND_PARTS_MAIN find-parts.c util.o xasprintf.o -lparted |
| 13 |
|
| 14 |
mkfstab: LDLIBS := -ldebian-installer |
| 15 |
mkfstab: mkfstab.o xasprintf.o |
| 16 |
|
| 17 |
mountpoint: LDLIBS := -ldebian-installer |
| 18 |
mountpoint: mountpoint.o |
| 19 |
|
| 20 |
xasprintf.o: xasprintf.c xasprintf.h |
| 21 |
util.o: util.c |
| 22 |
find-parts.o: find-parts.c partconf.h |
| 23 |
|
| 24 |
small: CFLAGS += -Os |
| 25 |
small: clean find-partitions mkfstab mountpoint |
| 26 |
$(STRIP) --remove-section=.comment --remove-section=.note find-partitions |
| 27 |
$(STRIP) --remove-section=.comment --remove-section=.note mkfstab |
| 28 |
$(STRIP) --remove-section=.comment --remove-section=.note mountpoint |
| 29 |
|
| 30 |
test-mkfstab: mkfstab.c mkfstab.h |
| 31 |
$(CC) $(CFLAGS) -o test-mkfstab -DTEST mkfstab.c xasprintf.o -lparted -ldebian-installer |
| 32 |
|
| 33 |
check: test-mkfstab |
| 34 |
./test-mkfstab |
| 35 |
|
| 36 |
clean: |
| 37 |
-rm -f find-partitions mkfstab mountpoint \ |
| 38 |
test-mkfstab *.o |
| 39 |
|
| 40 |
.PHONY: all check clean small |