From 8c2f6c9e3636091ad1ba5608e03820e4ff5629ff Mon Sep 17 00:00:00 2001 From: teajay Date: Thu, 18 Jun 2020 18:58:16 +0200 Subject: [PATCH 1/2] The mighty power of make --- abgabe4nochmal/Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 abgabe4nochmal/Makefile diff --git a/abgabe4nochmal/Makefile b/abgabe4nochmal/Makefile new file mode 100644 index 0000000..7e6526c --- /dev/null +++ b/abgabe4nochmal/Makefile @@ -0,0 +1,31 @@ +TARGET ?= main +SRC_DIRS ?= ./src +LIB_DIRS ?= ./lib +INC_DIRS ?= ./include ./include/eigen-3.3.7 +SYS_LIBS ?= -lncurses +LDLIBS = -lgsl -lgslcblas + +SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) +OBJS := $(addsuffix .o,$(basename $(SRCS))) +LIBS := $(shell find $(LIB_DIRS) -name *.a) +DEPS := $(OBJS:.o=.d) + + +#all: +# @echo $(value LIBS) + +INC_DIRS += $(shell find $(SRC_DIRS) -type d) + +INC_FLAGS := $(addprefix -I,$(INC_DIRS)) + +CPPFLAGS ?= $(INC_FLAGS) -MMD -MP + +$(TARGET): $(OBJS) + $(CXX) -pthread $(LDFLAGS) $(OBJS) $(LIBS) $(SYS_LIBS) -o $@ $(LOADLIBES) $(LDLIBS) -std=c++11 -O3 + $(RM) $(OBJS) $(DEPS) + +.PHONY: clean +clean: + $(RM) $(TARGET) $(OBJS) $(DEPS) + +#-include $(DEPS) From 0e4a3a9adef9acea9c8ce730fa6dd8162458c93c Mon Sep 17 00:00:00 2001 From: teajay Date: Thu, 18 Jun 2020 18:59:34 +0200 Subject: [PATCH 2/2] The mighty power of make --- abgabe4nochmal/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abgabe4nochmal/Makefile b/abgabe4nochmal/Makefile index 7e6526c..a439065 100644 --- a/abgabe4nochmal/Makefile +++ b/abgabe4nochmal/Makefile @@ -1,7 +1,7 @@ TARGET ?= main SRC_DIRS ?= ./src LIB_DIRS ?= ./lib -INC_DIRS ?= ./include ./include/eigen-3.3.7 +INC_DIRS ?= ./include ./eigen-3.3.7 SYS_LIBS ?= -lncurses LDLIBS = -lgsl -lgslcblas