Makefile: rename variable to be more clear
[model-checker.git] / Makefile
index 657bad6559ed259db5ec0f28cb966a4293b02de8..9b20f4c8a65632c7d0f1c25e18417b38724c9ff2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,12 +21,15 @@ program_H_SRCS := $(wildcard *.h) $(wildcard include/*.h)
 program_C_SRCS := $(wildcard *.c) $(wildcard *.cc)
 DEPS = make.deps
 
-all: $(LIB_SO) $(DEPS) tests
+all: $(LIB_SO) tests
 
+$(DEPS): build_deps := 1
 $(DEPS): $(program_C_SRCS) $(program_H_SRCS)
        $(CXX) -MM $(program_C_SRCS) $(CPPFLAGS) > $(DEPS)
 
+ifeq ($(build_deps),1)
 include $(DEPS)
+endif
 
 debug: CPPFLAGS += -DCONFIG_DEBUG
 debug: all
@@ -39,9 +42,9 @@ $(LIB_SO): $(OBJECTS)
        $(CXX) $(SHARED) -o $(LIB_SO) $(OBJECTS) $(LDFLAGS)
 
 malloc.o: malloc.c
-       $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=0 $(CPPFLAGS) -Wno-unused-variable -Wno-self-assign
+       $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=0 $(CPPFLAGS) -Wno-unused-variable
 
-%.o: %.cc
+%.o: %.cc $(DEPS)
        $(CXX) -fPIC -c $< $(CPPFLAGS)
 
 PHONY += clean
@@ -61,16 +64,16 @@ PHONY += tests
 tests: $(LIB_SO)
        $(MAKE) -C $(TESTS_DIR)
 
-BENCHMARKS := benchmarks
+BENCH_DIR := benchmarks
 
 PHONY += benchmarks
 benchmarks: $(LIB_SO)
-       @if ! test -d $(BENCHMARKS); then \
-               echo "Directory $(BENCHMARKS) does not exist" && \
+       @if ! test -d $(BENCH_DIR); then \
+               echo "Directory $(BENCH_DIR) does not exist" && \
                echo "Please clone the benchmarks repository" && \
                echo && \
                exit 1; \
        fi
-       $(MAKE) -C $(BENCHMARKS)
+       $(MAKE) -C $(BENCH_DIR)
 
 .PHONY: $(PHONY)