You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
714 B
31 lines
714 B
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 -ffast-math $(LDFLAGS) $(OBJS) $(LIBS) $(SYS_LIBS) -o $@ $(LOADLIBES) $(LDLIBS) -std=c++11 -O3
|
|
$(RM) $(OBJS) $(DEPS)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) $(TARGET) $(OBJS) $(DEPS)
|
|
|
|
#-include $(DEPS)
|