-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (29 loc) · 1.26 KB
/
Makefile
File metadata and controls
42 lines (29 loc) · 1.26 KB
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
42
BINDIR = ./build/
CC = g++
INCL = include/
OBJDIR = objects/
LIBSRC := $(wildcard library/*.h)
LIBOBJS := $(LIBSRC:library/%.h=objects/%.o)
CFLAGS = -ggdb -std=c++20 -fext-numeric-literals -Wall -Wextra -Wfloat-equal -Wundef -Wshadow=compatible-local -Wpointer-arith -Winit-self
PHONY: example all
all: examples
examples: example-ping example-raylib example-tictactoe
example-ping:
@$(CC) $(CFLAGS) -o $(BINDIR)$@-client examples/ping_server/simpleClient.cpp
@$(CC) $(CFLAGS) -o $(BINDIR)$@-server examples/ping_server/sampleServer.cpp
example-tictactoe:
@$(CC) $(CFLAGS) -o $(BINDIR)$@-client examples/tic_tac_toe/client.cpp
@$(CC) $(CFLAGS) -o $(BINDIR)$@-server examples/tic_tac_toe/server.cpp
example-raylib:
@$(CC) $(CFLAGS) -lraylib -o $(BINDIR)$@-client examples/raylib_2d_example/multiplayer_client.cpp
@$(CC) $(CFLAGS) -lraylib -o $(BINDIR)$@-server examples/raylib_2d_example/multiplayer_server.cpp
tests/unit_tests: $(LIBSRC) ./tests/unit_tests.cpp
@cd tests/ && \
$(CC) $(CFLAGS) -lgtest -lgtest_main -o unit_tests ./unit_tests.cpp
.PHONY: test
test: tests/unit_tests
./tests/unit_tests
# $(LIBOBJS): $(OBJDIR)%.o : library/%.h
# $(CC) $(CFLAGS) -c $< -o $(OBJDIR)$@
# $(INCL)lib-net.o: $(LIBOBJS)
# ar -rcs $(INCL)net-lib.a $(LIBOBJS)