summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Nilsson <troglobit@gmail.com>2012-11-06 18:17:09 (GMT)
committerJoachim Nilsson <troglobit@gmail.com>2012-11-06 18:17:09 (GMT)
commit6b84019fbb04aa669640d4542e1765339dba582a (patch)
treedcd7067acaec24eb664ab33ee5b6069687c81643
parentc5f2432f5e03c401c8f110f086d36803e870f673 (diff)
Add missing file, commit.mk1.5
-rw-r--r--Makefile2
-rw-r--r--common.mk25
2 files changed, 26 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c393986..e58a860 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@
ROOTDIR ?= $(shell pwd)
# VERSION ?= $(shell git tag -l | tail -1)
-VERSION ?= 1.4
+VERSION ?= 1.5
NAME = watchdogd
PKG = $(NAME)-$(VERSION)
ARCHIVE = $(PKG).tar.xz
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000..05f86e1
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,25 @@
+# Some junk files we always want to be removed when doing a make clean.
+JUNK = *~ *.bak *.aux *.dvi *.idx *.ind *.log *.ps *.map .*.d DEADJOE semantic.cache *.gdb *.elf core core.*
+MAKE := @$(MAKE)
+MAKEFLAGS = --no-print-directory --silent
+INSTALL := install --backup=off
+STRIPINST := $(INSTALL) -s --strip-program=$(CROSS)strip -m 0755
+
+# Smart autodependecy generation via GCC -M.
+.%.d: %.c
+ @$(SHELL) -ec "$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< \
+ | sed 's,.*: ,$*.o $@ : ,g' > $@; \
+ [ -s $@ ] || rm -f $@"
+
+# Override default implicit rules
+%.o: %.c
+ @printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
+ @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+%: %.o
+ @printf " LINK $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
+ @$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$@.map -o $@ $^ $(LDLIBS$(LDLIBS-$(@)))
+
+%.so: %.o
+ @printf " PLUGIN $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
+ @$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)