-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (56 loc) · 1.72 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
CC=gcc
CXX=g++
RM= /bin/rm -vf
PYTHON=python3
ARCH=UNDEFINED
PWD=$(shell pwd)
CDR=$(shell pwd)
EDCFLAGS:=$(CFLAGS)
EDLDFLAGS:=$(LDFLAGS)
EDDEBUG:=$(DEBUG)
ifeq ($(ARCH),UNDEFINED)
ARCH=$(shell uname -m)
endif
UNAME_S := $(shell uname -s)
CXXFLAGS:= -I include/ -I network/ -I imgui/include -I drivers/ -I imgui/include/imgui -I imgui/include/implot -I ./ -Wall -O2 -fpermissive -DGSNID=\"guiclient\" # -DCOMPILING_SYSTEM
LIBS =
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
LIBS += -lGL `pkg-config --static --libs glfw3`
CXXFLAGS += `pkg-config --cflags glfw3`
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
LIBS += -L/usr/local/lib -L/opt/local/lib
#LIBS += -lglfw3
LIBS += -lglfw
CXXFLAGS += -I/usr/local/include -I/opt/local/include
CFLAGS = $(CXXFLAGS)
endif
EDCFLAGS:= -O3 -Wall -std=gnu11 -mfp16-format=ieee $(EDCFLAGS)
EDLDFLAGS:= -lm -lpthread $(EDLDFLAGS)
LIBS += -lm -lpthread
BUILDGUI=imgui/libimgui_glfw.a
BUILDCPP=src/buffer.o network/network.o src/gs.o src/gs_gui.o src/gs_guimain.o
GUITARGET=gs.out
all: $(GUITARGET)
@echo Finished building $(GUITARGET) for $(ECHO_MESSAGE)
sudo ./$(GUITARGET)
$(GUITARGET): $(BUILDDRV) $(BUILDGUI) $(BUILDCPP)
$(CXX) $(BUILDDRV) $(BUILDCPP) -o $(GUITARGET) $(CXXFLAGS) $(BUILDGUI) $(LIBS)
$(BUILDGUI):
cd $(PWD)/imgui && make -j$(nproc) implot=1 && cd $(PWD)
%.o: %.c
$(CC) $(EDCFLAGS) $(EDDEBUG) -Iinclude/ -Idrivers/ -I./ -o $@ -c $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
.PHONY: clean
clean:
$(RM) $(BUILDDRV)
$(RM) $(GUITARGET)
$(RM) $(BUILDCPP)
spotless: clean
$(RM) -R build
cd $(PWD)/imgui && make spotless && cd $(PWD)