-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
33 lines (24 loc) · 1.24 KB
/
Makefile
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
CXXFILES := $(wildcard src/*.cpp) $(wildcard src/dir/*.cpp) $(wildcard src/interface/*.cpp) $(wildcard src/extraction/*.cpp)
CFILES :=
HEADERS := $(wildcard src/include/*.h)
CPPFLAGS := -Isrc/ -D_GNU_SOURCE
LUAVERSION := $(shell pkg-config --exists lua && echo lua || (pkg-config --exists lua5.2 && echo lua5.2 || echo none))
ifeq ($(LUAVERSION),none)
$(error Can't find Lua development support. Please install Lua development support \
(liblua-dev (deb) or lua-devel (rpm)) and check that pkg-config knows about Lua development)
endif
WARNFLAGS := -Werror -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wcast-align -Wunused -Woverloaded-virtual \
-Wpedantic -Wconversion -Wsign-conversion -Wlogical-op -Wuseless-cast -Wdouble-promotion \
-Wold-style-cast -Wno-missing-field-initializers
BASEFLAGS := $(WARNFLAGS) -ggdb2 -pthread $(shell pkg-config --cflags $(LUAVERSION)) $(USER_DEFINES)
CXXFLAGS := -std=c++17 $(BASEFLAGS)
CFLAGS := -std=c99 $(BASEFLAGS)
LDFLAGS := $(shell pkg-config --libs $(LUAVERSION)) -lrt -pthread -lssl -lcrypto -lutil -lstdc++fs
OBJS := $(CXXFILES:.cpp=.o) $(CFILES:.c=.o)
all: buildsys
$(OBJS): Makefile $(HEADERS)
buildsys: Makefile $(OBJS)
$(LINK.cpp) -o $@ $(OBJS) $(LDFLAGS)
clean:
rm -f $(OBJS) buildsys
.PHONY: test