projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefile: don't always rebuild make.deps
[c11tester.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index 67b6e6dfa5212438321639f5e4ef11bc8e2768e5..2bd61ce26c0c13b7f87798b671869fea9fc49a6d 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-6,10
+6,17
@@
OBJECTS = libthreads.o schedule.o model.o threads.o librace.o action.o \
snapshot.o malloc.o mymemory.o
CPPFLAGS += -Iinclude -I.
snapshot.o malloc.o mymemory.o
CPPFLAGS += -Iinclude -I.
-LDFLAGS
=
-ldl -lrt
-SHARED
=
-shared
+LDFLAGS
=
-ldl -lrt
+SHARED
=
-shared
-TESTS=test
+# Mac OSX options
+ifeq ($(UNAME), Darwin)
+CPPFLAGS += -D_XOPEN_SOURCE -DMAC
+LDFLAGS = -ldl
+SHARED = -Wl,-undefined,dynamic_lookup -dynamiclib
+endif
+
+TESTS_DIR = test
program_H_SRCS := $(wildcard *.h) $(wildcard include/*.h)
program_C_SRCS := $(wildcard *.c) $(wildcard *.cc)
program_H_SRCS := $(wildcard *.h) $(wildcard include/*.h)
program_C_SRCS := $(wildcard *.c) $(wildcard *.cc)
@@
-18,18
+25,16
@@
DEPS = make.deps
all: $(LIB_SO) $(DEPS) tests
$(DEPS): $(program_C_SRCS) $(program_H_SRCS)
all: $(LIB_SO) $(DEPS) tests
$(DEPS): $(program_C_SRCS) $(program_H_SRCS)
- $(CXX)
$(CPPFLAGS) -MM $(program_C_SRC
S) > $(DEPS)
+ $(CXX)
-MM $(program_C_SRCS) $(CPPFLAG
S) > $(DEPS)
+# Only include, rebuild make.deps when it's going to be used
+ifeq ($(MAKECMDGOALS),$(DEPS))
include $(DEPS)
include $(DEPS)
+endif
debug: CPPFLAGS += -DCONFIG_DEBUG
debug: all
debug: CPPFLAGS += -DCONFIG_DEBUG
debug: all
-mac: CPPFLAGS += -D_XOPEN_SOURCE -DMAC -DCONFIG_DEBUG
-mac: LDFLAGS=-ldl
-mac: SHARED=-Wl,-undefined,dynamic_lookup -dynamiclib
-mac: all
-
docs: *.c *.cc *.h
doxygen
docs: *.c *.cc *.h
doxygen
@@
-44,7
+49,7
@@
malloc.o: malloc.c
clean:
rm -f *.o *.so
clean:
rm -f *.o *.so
- $(MAKE) -C $(TESTS) clean
+ $(MAKE) -C $(TESTS
_DIR
) clean
mrclean: clean
rm -rf docs
mrclean: clean
rm -rf docs
@@
-53,4
+58,4
@@
tags::
ctags -R
tests:: $(LIB_SO)
ctags -R
tests:: $(LIB_SO)
- $(MAKE) -C $(TESTS)
+ $(MAKE) -C $(TESTS
_DIR
)