makefile for pps-tools
[wyse_ntpd.git] / src / pps-tools / Makefile
1 TARGETS = ppstest ppsctl ppswatch
2
3 CFLAGS += -Wall -O2 -D_GNU_SOURCE -m32 -static
4 CFLAGS += -I .
5 CFLAGS += -ggdb
6 CFLAGS += -D__N_PPS=18
7
8 # -- Actions section --
9
10 .PHONY : all depend dep
11
12 all : .depend $(TARGETS)
13
14 .depend depend dep :
15         $(CC) $(CFLAGS) -M $(TARGETS:=.c) > .depend
16
17 ifeq (.depend,$(wildcard .depend))
18 include .depend
19 endif
20
21 install : all
22         install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
23         install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
24
25 uninstall :
26         for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
27         rm $(DESTDIR)/usr/include/sys/timepps.h
28
29 # -- Clean section --
30
31 .PHONY : clean
32
33 clean :
34         rm -f *.o *~ core .depend
35         rm -f ${TARGETS}