-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 787 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CXX=g++
LDFLAGS := -lboost_program_options -L/usr/local/lib
CXXFLAGS := -g -std=c++1z -Wall -pedantic
EXECUTABLE ?= hyper
TYPE ?= debug
TARGET ?= target/$(TYPE)
OBJ_DIR ?= $(TARGET)/objs
INC_DIRS ?= $(addprefix -I, $(shell find packages -type d -name include))
SRC_FILES = $(shell find src -type f -print | grep "\.cpp")
OBJ_FILES := $(addprefix $(OBJ_DIR)/,$(SRC_FILES:.cpp=.o))
INC_DIRS += -I/usr/local/include/ -Iinclude
LDFLAGS += $(INC_DIRS)
CXXFLAGS += $(INC_DIRS)
all: $(TARGET)/$(EXECUTABLE)
$(TARGET)/$(EXECUTABLE): $(OBJ_FILES)
$(CXX) $(LDFLAGS) -o $@ $^
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c -o $@ $<
run: $(TARGET)/$(EXECUTABLE)
@./$(TARGET)/$(EXECUTABLE)
.PHONY: clean
submodule:
@git submodule foreach git pull
clean:
rm -r $(TARGET)