-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (42 loc) · 1.66 KB
/
Makefile
File metadata and controls
46 lines (42 loc) · 1.66 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
43
44
45
46
# Build Flags and plateform specific flags
CC = g++
UNIXLIBS = -lGLEW -lGL
WINLIBS = -lglew32 -lopengl32 -DGLEW_STATIC -lws2_32 -DWIN -DSDL_MAIN_HANDLED -static-libgcc -static-libstdc++
CFLAGS = -std=c++23 -Wall -lSDL2 -I./vender -DGLM_ENABLE_EXPERIMENTAL -Wextra
DBG = -g
# File Names
SOURCES = $(wildcard *.cpp)
BUILDDIRNAME = build
OUT = voxelclient
RELEASENAME = $(BUILDDIRNAME)-$(OUT)-all.zip
.PHONY: all clean release $(BUILDDIRNAME)
all: $(BUILDDIRNAME)/$(OUT) $(BUILDDIRNAME)/$(OUT).exe $(BUILDDIRNAME)/voxelserver $(BUILDDIRNAME)/voxelserver.exe
-@mkdir $(BUILDDIRNAME) -p
cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/* $(BUILDDIRNAME)
cp shader $(BUILDDIRNAME) -r
cp picture $(BUILDDIRNAME) -r
cp bootstrap* $(BUILDDIRNAME)
cp doc $(BUILDDIRNAME) -r
cp README.md $(BUILDDIRNAME)
$(BUILDDIRNAME)/voxelserver.exe:
-@mkdir $(BUILDDIRNAME) -p
@echo "Building Voxel Server(WIN64)!"
@cargo build --manifest-path=voxelserver/Cargo.toml --target=x86_64-pc-windows-gnu
cp voxelserver/target/x86_64-pc-windows-gnu/debug/voxelserver.exe $(BUILDDIRNAME)
$(BUILDDIRNAME)/voxelserver:
-@mkdir $(BUILDDIRNAME) -p
@echo "Building Voxel Server!"
@cargo build --manifest-path=voxelserver/Cargo.toml
cp voxelserver/target/debug/voxelserver $(BUILDDIRNAME)
$(BUILDDIRNAME)/$(OUT): $(SOURCES)
-@mkdir $(BUILDDIRNAME) -p
$(CC) $(SOURCES) -o $@ $(CFLAGS) $(DBG) $(UNIXLIBS)
$(BUILDDIRNAME)/$(OUT).exe: $(SOURCES) # Only one supportoed compiler for windows
-@mkdir $(BUILDDIRNAME) -p
x86_64-w64-mingw32-g++ $(SOURCES) -o $@ $(CFLAGS) $(DBG) $(WINLIBS)
$(RELEASENAME): all
zip $(RELEASENAME) $(BUILDDIRNAME) -r
release: $(RELEASENAME)
clean:
-rm $(BUILDDIRNAME) -rf
-rm $(RELEASENAME) -rf