This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Jamfile
130 lines (118 loc) · 6.18 KB
/
Jamfile
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#---- setup ----
#This portion of the Jamfile sets up compiler and linker flags per-OS.
#You shouldn't need to change it.
if $(OS) = NT { #Windows
NEST_LIBS = ..\\nest-libs\\windows ;
C++FLAGS = /nologo /Z7 /c /EHsc /W3 /WX /MD /std:c++17
/I"$(NEST_LIBS)/SDL2/include"
/I"$(NEST_LIBS)/glm/include"
/I"$(NEST_LIBS)/libpng/include"
#/I"$(NEST_LIBS)/opusfile/include"
#/I"$(NEST_LIBS)/libopus/include"
#/I"$(NEST_LIBS)/libogg/include"
#/I"$(NEST_LIBS)/harfbuzz/include"
#/I"$(NEST_LIBS)/freetype/include"
#disable a few warnings:
/wd4146 #-1U is still unsigned
/wd4297 #unforunately SDLmain is nothrow
;
LINKFLAGS = /nologo /SUBSYSTEM:CONSOLE /DEBUG:FASTLINK
/LIBPATH:"$(NEST_LIBS)/SDL2/lib"
/LIBPATH:"$(NEST_LIBS)/libpng/lib"
/LIBPATH:"$(NEST_LIBS)/zlib/lib"
#/LIBPATH:"$(NEST_LIBS)/opusfile/lib"
#/LIBPATH:"$(NEST_LIBS)/libopus/lib"
#/LIBPATH:"$(NEST_LIBS)/libogg/lib"
#/LIBPATH:"$(NEST_LIBS)/harfbuzz/lib"
#/LIBPATH:"$(NEST_LIBS)/freetype/lib"
;
LINKLIBS =
SDL2main.lib SDL2.lib OpenGL32.lib Shell32.lib
libpng.lib zlib.lib #opusfile.lib opus.lib libogg.lib harfbuzz.lib freetype.lib
;
File SDL2.dll : $(NEST_LIBS)\\SDL2\\dist\\SDL2.dll ;
File README-SDL.txt : $(NEST_LIBS)\\SDL2\\dist\\README-SDL.txt ;
File README-glm.txt : $(NEST_LIBS)\\glm\\dist\\README-glm.txt ;
File README-libpng.txt : $(NEST_LIBS)\\libpng\\dist\\README-libpng.txt ;
#File README-libopus.txt : $(NEST_LIBS)\\libopus\\dist\\README-libopus.txt ;
#File README-opusfile.txt : $(NEST_LIBS)\\opusfile\\dist\\README-opusfile.txt ;
#File README-libogg.txt : $(NEST_LIBS)\\libogg\\dist\\README-libogg.txt ;
#File README-harfbuzz.txt : $(NEST_LIBS)\\harfbuzz\\dist\\README-harfbuzz.txt ;
#File README-freetype.txt : $(NEST_LIBS)\\freetype\\dist\\README-freetype.txt ;
#File README-libopusenc.txt : $(NEST_LIBS)\\libopusenc\\dist\\README-libopusenc.txt ; #not needed unless you distribute libopusenc with your pipeline code
#Tell Jam that all of the above README files go into the dist/ directory:
MakeLocate SDL2.dll : dist ;
MakeLocate README-SDL.txt README-glm.txt README-libpng.txt README-libopus.txt README-opusfile.txt README-libogg.txt README-harfbuzz.txt README-freetype.txt README-libopusenc.txt : dist ;
} else if $(OS) = MACOSX { #MacOS
NEST_LIBS = ../nest-libs/macos ;
C++ = clang++ ;
C++FLAGS =
-std=c++14 -g -Wall -Werror
`'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --cflags` #SDL2
-I$(NEST_LIBS)/glm/include #glm
-I$(NEST_LIBS)/libpng/include #libpng
#-I$(NEST_LIBS)/opusfile/include #opusfile
#-I$(NEST_LIBS)/libopus/include #libopus
#-I$(NEST_LIBS)/libogg/include #libogg
#-I$(NEST_LIBS)/freetype/include #freetype
#-I$(NEST_LIBS)/harfbuzz/include #harfbuzz
;
LINK = clang++ ;
LINKFLAGS = -std=c++14 -g -Wall -Werror ;
LINKLIBS =
`'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --static-libs` -framework OpenGL #SDL2
-L$(NEST_LIBS)/libpng/lib -lpng #libpng
-L$(NEST_LIBS)/zlib/lib -lz #zlib (for libpng)
#-L$(NEST_LIBS)/opusfile/lib -lopusfile #opusfile
#-L$(NEST_LIBS)/libopus/lib -lopus #libopus (for opusfile)
#-L$(NEST_LIBS)/libogg/lib -logg #libogg (for opusfile)
#-L$(NEST_LIBS)/harfbuzz/lib -lharfbuzz #harfbuzz
#-L$(NEST_LIBS)/freetype/lib -lfreetype #freetype
;
File README-SDL.txt : $(NEST_LIBS)/SDL2/dist/README-SDL.txt ;
MakeLocate README-SDL.txt : dist ;
} else if $(OS) = LINUX { #Linux
NEST_LIBS = ../nest-libs/linux ;
C++ = g++ -no-pie ;
C++FLAGS =
-std=c++14 -g -Wall -Werror
`'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --cflags` #SDL2
-I$(NEST_LIBS)/glm/include #glm
-I$(NEST_LIBS)/libpng/include #libpng
;
LINK = g++ -no-pie ;
LINKFLAGS = -std=c++14 -g -Wall -Werror ;
LINKLIBS =
`'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --static-libs` -lGL #SDL2
-L$(NEST_LIBS)/libpng/lib -lpng #libpng
-L$(NEST_LIBS)/zlib/lib -lz #zlib
;
#`PATH=$(KIT_LIBS)/SDL2/bin:$PATH sdl2-config --static-libs` -lGL #SDL2 (old way that allows system libs to also work)
File README-SDL.txt : $(NEST_LIBS)/SDL2/dist/README-SDL.txt ;
File README-glm.txt : $(NEST_LIBS)/glm/dist/README-glm.txt ;
File README-libpng.txt : $(NEST_LIBS)/libpng/dist/README-libpng.txt ;
#File README-libopus.txt : $(NEST_LIBS)/libopus/dist/README-libopus.txt ;
#File README-opusfile.txt : $(NEST_LIBS)/opusfile/dist/README-opusfile.txt ;
#File README-libogg.txt : $(NEST_LIBS)/libogg/dist/README-libogg.txt ;
#File README-harfbuzz.txt : $(NEST_LIBS)/harfbuzz/dist/README-harfbuzz.txt ;
#File README-freetype.txt : $(NEST_LIBS)/freetype/dist/README-freetype.txt ;
#File README-libopusenc.txt : $(NEST_LIBS)/libopusenc/dist/README-libopusenc.txt ; #not needed unless you distribute libopusenc with your pipeline code
#Tell Jam that all of the above README files go into the dist/ directory:
MakeLocate README-SDL.txt README-glm.txt README-libpng.txt README-libopus.txt README-opusfile.txt README-libogg.txt README-harfbuzz.txt README-freetype.txt README-libopusenc.txt : dist ;
}
#---- build ----
#This is the part of the file that tells Jam how to build your project.
#Store the names of all the .cpp files to build into a variable:
GAME_NAMES =
PongMode
main
load_save_png
gl_compile_program
ColorTextureProgram
Mode
GL
;
LOCATE_TARGET = objs ; #put objects in 'objs' directory
Objects $(GAME_NAMES:S=.cpp) ;
LOCATE_TARGET = dist ; #put main in 'dist' directory
MainFromObjects pong : $(GAME_NAMES:S=$(SUFOBJ)) ;