-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (23 loc) · 835 Bytes
/
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
TARGET = bin/typeordie
CC = gcc
CFLAGS = -std=c++11 -Werror -Wall -Wextra -Wno-unused-parameter
ifeq ($(OS),Windows_NT)
LIBS = -mwindows -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lopengl32 -lvorbisfile -lvorbisenc -lvorbis -logg -lboost_program_options -lstdc++
else
LIBS = -lGL -lSDL2 -lSDL2_mixer -lm -lboost_program_options -lstdc++
endif
.PHONY: default all clean
default: $(TARGET)
all: default
debug: CFLAGS += -g -O0 -D_DEBUG
debug: default
OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp))
HEADERS = $(wildcard *.h)
%.o: %.cpp $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) $(LIBS) -o $@
clean:
-rm -f *.o
-rm -r $(TARGET)