-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (28 loc) · 750 Bytes
/
Makefile
File metadata and controls
41 lines (28 loc) · 750 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
34
35
36
37
38
39
40
41
DISABLED_WARNINGS = -Wno-format-security
CXX = g++
CXXFLAGS := -Wall -Wextra -std=c++17 $(DISABLED_WARNINGS)
BUILD = build
INCLUDE = include
SRC = src
OBJS := $(BUILD)/objs
SOURCES := $(wildcard $(SRC)/*.cc)
OBJECTS := $(patsubst $(SRC)/%.cc, $(OBJS)/%.o, $(SOURCES))
BIN := $(BUILD)/scriptlang
all: create-build-folder $(BIN)
debug: CXXFLAGS += -ggdb -DDEBUG
debug: all
$(BIN): $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@
$(OBJS)/%.o: $(SRC)/%.cc $(INCLUDE)/%.h
$(CXX) -c $(CXXFLAGS) $< -o $@
$(OBJS)/%.o: $(SRC)/%.cc
$(CXX) -c $(CXXFLAGS) $< -o $@
.PHONY: clean create-build-folder add debug
add:
@touch $(SRC)/$(file).cc
@touch $(INCLUDE)/$(file).h
clean:
@rm -rf $(BUILD)
create-build-folder:
@mkdir -p $(BUILD)
@mkdir -p $(OBJS)