Add special rule to make cmdline.o.
[dss.git] / Makefile
1 dss_objects := cmdline.o dss.o string.o fd.o exec.o signal.o daemon.o df.o time.o snap.o
2 all: dss
3 man: dss.1
4
5 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
6 DEBUG_CPPFLAGS += -Wredundant-decls
7 CPPFLAGS += -Os
8 CPPFLAGS += -Wall
9 CPPFLAGS += -Wuninitialized
10 CPPFLAGS += -Wchar-subscripts
11 CPPFLAGS += -Wformat-security
12 CPPFLAGS += -Werror-implicit-function-declaration
13 CPPFLAGS += -Wmissing-format-attribute
14 CPPFLAGS += -Wunused-macros
15 CPPFLAGS += -Wbad-function-cast
16
17 Makefile.deps: $(wildcard *.c *.h)
18 gcc -MM -MG *.c > $@
19
20 -include Makefile.deps
21
22 dss: $(dss_objects)
23 $(CC) -o $@ $(dss_objects)
24
25 cmdline.o: cmdline.c cmdline.h
26 $(CC) -c $(CPPFLAGS) $<
27
28 %.o: %.c Makefile
29 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
30
31 %.ppm: %.sk
32 sk2ppm $< > $@
33 %.png: %.ppm
34 convert $< $@
35
36 cmdline.c cmdline.h: dss.ggo
37 gengetopt --conf-parser < $<
38
39 dss.1: dss
40 help2man -h --detailed-help -N ./$< > $@
41
42 %.1.html: %.1
43 man2html $< > $@
44
45 clean:
46 rm -f *.o dss dss.1 dss.1.html Makefile.deps *.ppm *.png *~ cmdline.c cmdline.h
47
48