-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 1.03 KB
/
Makefile
File metadata and controls
33 lines (26 loc) · 1.03 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
WINDOWS =
ifeq ($(OS),Windows_NT)
WINDOWS = yes
endif
CC=gcc
CFLAGS=
SER_LIBS=-lpthread
CLI_LIBS=-lws2_32
SER_SRC=src/server
CLI_SRC=src/client
CMN_SRC=src/common
%.o: %.c %.h
$(CC) $(CFLAGS) -c -o $@ $<
server: $(SER_SRC)/main.o $(CMN_SRC)/network_constants.o $(CMN_SRC)/string_functions/string_functions.o $(SER_SRC)/network_functions/network_functions.o $(SER_SRC)/client_handling/client_handling.o
$(CC) $(CFLAGS) -o server $(SER_SRC)/main.o $(CMN_SRC)/network_constants.o $(CMN_SRC)/string_functions/string_functions.o $(SER_SRC)/network_functions/network_functions.o $(SER_SRC)/client_handling/client_handling.o $(SER_LIBS)
client:
$(CC) $(CFLAGS) -o client $(CLI_SRC)/main.c $(CLI_SRC)/left_click.c $(CLI_SRC)/string_util.c $(CLI_SRC)/usleep.c src/common/string_functions/string_functions.c src/common/network_constants.c $(CLI_LIBS)
.PHONY: clean
clean:
ifdef WINDOWS
del server client.exe
powershell -noprofile -command "ls *.o -Recurse | foreach {rm $$_}"
else
rm -f server client.exe
find . -type f -name '*.o' -delete
endif