diff --git a/abgabe4nochmal/Makefile b/abgabe4nochmal/Makefile new file mode 100644 index 0000000..a439065 --- /dev/null +++ b/abgabe4nochmal/Makefile @@ -0,0 +1,31 @@ +TARGET ?= main +SRC_DIRS ?= ./src +LIB_DIRS ?= ./lib +INC_DIRS ?= ./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)