about summary refs log tree commit homepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4acac90
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+# default target
+all::
+
+# overridable from command-line
+CFLAGS = -g -O2 -Wall
+LDFLAGS = -Wl,-O1
+
+fadvise.c: compat-util.h
+mincore.c: compat-util.h
+
+pcu-mincore: mincore.c
+pcu-fadvise: fadvise.c
+
+PCU_BIN := pcu-fadvise pcu-mincore
+
+$(PCU_BIN):
+        $(CC) $(CFLAGS) $(LDFLAGS) -o $@+ $<
+        mv $@+ $@
+
+all:: $(PCU_BIN)
+
+GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
+        @./GIT-VERSION-GEN
+-include GIT-VERSION-FILE
+
+DISTNAME = pcu-$(GIT_VERSION)
+dist: GIT-VERSION-FILE
+        git archive --format=tar --prefix=$(DISTNAME)/ HEAD^{tree} \
+                | gzip -9 > $(DISTNAME).tar.gz+
+        mv $(DISTNAME).tar.gz+ $(DISTNAME).tar.gz
+clean:
+        $(RM) $(PCU_BIN) $(DISTNAME).tar.gz*
+
+.PHONY: .FORCE-GIT-VERSION-FILE