aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: e48afa64b935eb0b3a43a72be0fcc07797b69bde (plain)
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
LIBS = -lpthread -lGL -lGLEW -lSDL2 -lfreetype -lSDL2_image -lSDL2_mixer

WIN_LIBS = -lopengl32 -lglew32 -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype

FLAGS = -std=c++11 -Iinclude -Iinclude/freetype2 -Wall -Wextra -Werror

MFLAGS64 = 64
all:
	@echo "Building for 32-bit target"
	@rm -f out/*.o
	@cd src; $(MAKE) $(MFLAGS)
	@echo "  CXX  main.cpp"
	@g++ $(FLAGS) -m32 -o main main.cpp out/*.o $(LIBS) -lSDL2main

64:
	@echo "Building for 64-bit target"
	@rm -f out64/*.o
	@cd src; $(MAKE) $(MFLAGS64)
	@echo "  CXX  main.cpp"
	@g++ $(FLAGS) -m64 -o main main.cpp out64/*.o $(LIBS)

win32:
	@g++ $(FLAGS) -o main main.cpp src/*.cpp $(WIN_LIBS)
	
clean:
	@echo "  RM main"
	@-rm -f main
	@echo "  RM out/*.o"
	@-rm -f out/*.o
	@echo "  RM out64/*.o"
	@-rm -f out64/*.o