makefile for pps-tools
[wyse_ntpd.git] / src / pps-tools / Makefile
diff --git a/src/pps-tools/Makefile b/src/pps-tools/Makefile
new file mode 100644 (file)
index 0000000..d96f58c
--- /dev/null
@@ -0,0 +1,35 @@
+TARGETS = ppstest ppsctl ppswatch
+
+CFLAGS += -Wall -O2 -D_GNU_SOURCE -m32 -static
+CFLAGS += -I .
+CFLAGS += -ggdb
+CFLAGS += -D__N_PPS=18
+
+# -- Actions section --
+
+.PHONY : all depend dep
+
+all : .depend $(TARGETS)
+
+.depend depend dep :
+       $(CC) $(CFLAGS) -M $(TARGETS:=.c) > .depend
+
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif
+
+install : all
+       install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
+       install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
+
+uninstall :
+       for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
+       rm $(DESTDIR)/usr/include/sys/timepps.h
+
+# -- Clean section --
+
+.PHONY : clean
+
+clean :
+       rm -f *.o *~ core .depend
+       rm -f ${TARGETS}