File: Makefile

package info (click to toggle)
partconf 1.07
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 628 kB
  • ctags: 102
  • sloc: ansic: 1,357; makefile: 79; sh: 7
file content (44 lines) | stat: -rw-r--r-- 1,288 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
LIBS = -lparted -ldl
CFLAGS = -W -Wall

ifdef DEBUG
CFLAGS += -g3
endif

PARTCONF_OBJS = util.o partconf.o find-parts.o

all: partconf find-partitions mkfstab

partconf: $(PARTCONF_OBJS)
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -ldebconfclient -ldebian-installer

find-partitions: partconf.h find-parts.c util.o
	$(CC) $(CFLAGS) -o $@ -DFIND_PARTS_MAIN find-parts.c util.o $(LIBS) -ldebian-installer

mkfstab: mkfstab.c mkfstab.h
	$(CC) $(CFLAGS) -o $@ mkfstab.c $(LIBS) -ldebian-installer

util.o: util.c
partconf.o: partconf.c partconf.h
find-parts.o: find-parts.c partconf.h

small: CFLAGS += -Os
small: clean partconf find-partitions mkfstab
	strip --remove-section=.comment --remove-section=.note partconf
	strip --remove-section=.comment --remove-section=.note find-partitions
	strip --remove-section=.comment --remove-section=.note mkfstab

test-mkfstab: mkfstab.c mkfstab.h
	$(CC) $(CFLAGS) -o test-mkfstab -DTEST mkfstab.c $(LIBS) -ldebian-installer

test-partconf: find-parts.o partconf.c partconf.h util.o
	$(CC) $(CFLAGS) -o test-partconf -DTEST partconf.c find-parts.o util.o $(LIBS) -ldebian-installer

check: test-mkfstab test-partconf
	./test-mkfstab
	./test-partconf

clean:
	-rm -f partconf find-partitions mkfstab test-mkfstab test-partconf *.o

.PHONY: all check clean small