summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2012-02-23 15:15:46 -0500
committerPaul Moore <pmoore@redhat.com>2012-02-23 15:15:46 -0500
commita7249dc7ec66ea521930081ff303a70f8066c9ad (patch)
tree684da59f2be24484769caeb58b68d4f70fe0e492
parentd0b432e69bacd73fa5abc0f722c52ae8f81c911f (diff)
downloadlibseccomp-a7249dc7ec66ea521930081ff303a70f8066c9ad.tar.gz
tests: add the static library as a dependency
Also remove some unnecessary includes in the src/ and tests/ Makefiles. Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r--.gitignore1
-rw-r--r--macros.mk23
-rw-r--r--src/Makefile2
-rw-r--r--tests/Makefile2
4 files changed, 23 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 0bf6f9f..50a533a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
*.a
*.o
*.d
+*.dtmp
*.swp
*.orig
.stgit-*
diff --git a/macros.mk b/macros.mk
index c97a111..33c9e76 100644
--- a/macros.mk
+++ b/macros.mk
@@ -45,17 +45,36 @@ CFLAGS ?= -O0 -g -Wall
LDFLAGS ?= -g
#
-# auto dependencies
+# build tools
#
-# we require gcc specific functionality (see the MAKEDEP* definitions below)
+MV ?= mv
+CAT ?= cat
+ECHO ?= echo
+
+SED ?= sed
+
+# we require gcc specific functionality (see the MAKEDEP definitions below)
GCC ?= gcc
+#
+# auto dependencies
+#
+
MAKEDEP = @$(GCC) $(INCFLAGS) -MM -MF $(patsubst %.o,%.d,$@) $<;
MAKEDEP_EXEC = \
@$(GCC) $(INCFLAGS) -MM -MT $(patsubst %.d,%,$@) \
-MF $@ $(patsubst %.d,%.c,$@);
+ADDDEP = \
+ @adep() { \
+ $(MV) $$1 $$1.dtmp; \
+ $(CAT) $$1.dtmp | $(SED) -e 's/\([^\]\)$$/\1 \\/' | \
+ ( $(CAT) - && $(ECHO) " $$2" ) > $$1; \
+ $(RM) -f $@.dtmp; \
+ }; \
+ adep
+
#
# build constants
#
diff --git a/src/Makefile b/src/Makefile
index d8bff22..117ddfd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -37,8 +37,6 @@ LIB_SHARED = libseccomp.so.$(VERSION_RELEASE)
OBJS = api.o db.o hash.o gen_pfc.o gen_bpf.o
DEPS = $(OBJS:%.o=%.d)
-INCFLAGS := $(INCFLAGS) -I../include
-
#
# targets
#
diff --git a/tests/Makefile b/tests/Makefile
index 3535581..0601e20 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -35,7 +35,6 @@ include ../macros.mk
include ../version_info
-INCFLAGS := $(INCFLAGS) -I../include
LDFLAGS := ../src/libseccomp.a
TESTS = 01-allow \
@@ -57,6 +56,7 @@ all: $(TESTS)
$(DEPS):
$(MAKEDEP_EXEC)
+ $(ADDDEP) $@ ../src/libseccomp.a
$(TESTS):
$(COMPILE_EXEC)