From 04e8eab1c328b008c70308eebd9c6b12932ec2b5 Mon Sep 17 00:00:00 2001
From: Pjotr Prins
Date: Thu, 9 Nov 2017 08:55:52 +0000
Subject: Makefiles: reorder, and use version support for macos

---
 Makefile | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
index 2d91a49..3287654 100644
--- a/Makefile
+++ b/Makefile
@@ -104,10 +104,6 @@ endif
 
 OUTPUT = $(BIN_DIR)/gemma
 
-SOURCES = $(SRC_DIR)/main.cpp
-
-HDR =
-
 # Detailed libary paths, D for dynamic and S for static
 
 LIBS_LNX_D_LAPACK = -llapack
@@ -140,22 +136,25 @@ SOURCES      = $(wildcard src/*.cpp)
 # all
 OBJS = $(SOURCES:.cpp=.o)
 
+all: $(OUTPUT)
+
 ./src/version.h:
 	./scripts/gen_version_info.sh > src/version.h
 
-all: ./src/version.h $(OUTPUT)
-
 $(OUTPUT): $(OBJS)
 	$(CPP) $(CPPFLAGS) $(OBJS) $(LIBS) -o $(OUTPUT)
 
-$(OBJS)  : $(HDR)
+$(OBJS): $(HDR)
+
+# .cpp.o:
+# 	$(CPP) $(CPPFLAGS) -c $*.cpp -o $*.o
 
-.cpp.o:
-	$(CPP) $(CPPFLAGS) $(HEADERS) -c $*.cpp -o $*.o
 .SUFFIXES : .cpp .c .o $(SUFFIXES)
 
-unittests: all contrib/catch-1.9.7/catch.hpp $(TEST_SRC_DIR)/unittests-main.o $(TEST_SRC_DIR)/unittests-math.o
+./bin/unittests-gemma: contrib/catch-1.9.7/catch.hpp $(TEST_SRC_DIR)/unittests-main.o $(TEST_SRC_DIR)/unittests-math.o $(OBJS)
 	$(CPP) $(CPPFLAGS) $(TEST_SRC_DIR)/unittests-main.o  $(TEST_SRC_DIR)/unittests-math.o $(filter-out src/main.o, $(OBJS)) $(LIBS) -o ./bin/unittests-gemma
+
+unittests: ./bin/unittests-gemma
 	./bin/unittests-gemma
 
 fast-check: all unittests
-- 
cgit v1.2.3