Ticket #18824: Makefile

File Makefile, 498 bytes (added by LupusMichaelis, 9 months ago)

The receipe to build and test

Line 
1SRCS=$(wildcard *.cpp)
2OBJS=$(SRCS:.cpp=.o)
3DEPS=$(OBJS:.o=.d)
4
5LDFLAGS= \
6 -lbe \
7 -g -ggdb
8CXXFLAGS= \
9 -I/system/develop/headers \
10 -std=c++20 \
11 -Werror -Wall -Wextra -pedantic \
12 -g -ggdb
13
14.PHONY: clean bug
15
16lockdir: $(OBJS)
17 $(CXX) -o $@ $(OBJS) $(LDFLAGS)
18
19%.o: %.cpp
20 $(CXX) $(CXXFLAGS) -MMD -c $< -o $@
21
22-include $(DEPS)
23
24bug: lockdir
25 $(RM) -rf $(PWD)/toto/
26 mkdir -p $(PWD)/toto/
27 ./lockdir $(PWD)/toto `seq -w 0 999`
28 echo $?
29
30
31clean:
32 - $(RM) lockdir $(DEPS) $(OBJS)
33 - $(RM) -rf toto