aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 1cb47c3ccd6f14a73b1338b62ecf03c00eb943fa (plain)
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
CXXFLAGS += -g
CXXFLAGS += -std=c++20
TARGET = main

SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
DEPS := $(SRCS:.cpp=.d)

all: $(TARGET)

-include $(wildcard *.d)
all: $(DEPS)

$(TARGET): $(OBJS)
	$(CXX) $^ $(LFLAGS) -o $@

%.d: %.cpp
	$(CXX) -M $< -o $@

clean:
	$(RM) $(TARGET) $(OBJS) $(DEPS)

compile_commands.json:
	compiledb make -Bn