Various changes
- add release build - control framerate - fix bug that caused camera to shake - enable double-buffering and VSync
This commit is contained in:
10
makefile
10
makefile
@@ -2,17 +2,19 @@ INC = include
|
||||
OBJ = obj
|
||||
SRC = src
|
||||
EXE = Game
|
||||
REL = Release
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -w -ggdb -I$(INC)
|
||||
LIBS = -lGLEW -lGLU -lGL -lSDL2 -lcglm -lz -lm
|
||||
RELFLAGS = -O3 -s
|
||||
|
||||
OBJFILES := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(shell find $(SRC) -name '*.c'))
|
||||
OBJDIRS := $(patsubst $(SRC)%, $(OBJ)%, $(shell find $(SRC) -type d))
|
||||
CLEANDIRS := $(addsuffix /.clean, $(OBJDIRS));
|
||||
|
||||
# Explicit targets
|
||||
.PHONY: all clean
|
||||
.PHONY: all release clean
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
# Build executable
|
||||
@@ -28,8 +30,12 @@ $(OBJ)/%.o: $(SRC)/%.c | $(OBJDIRS)
|
||||
$(OBJDIRS):
|
||||
mkdir -p $@
|
||||
|
||||
release: $(REL)
|
||||
$(REL): $(OBJFILES) | $(OBJDIRS)
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) $(RELFLAGS)
|
||||
|
||||
# Delete previously built files
|
||||
clean: $(CLEANDIRS)
|
||||
rm -f $(EXE)
|
||||
rm -f $(EXE) $(REL)
|
||||
%.clean:
|
||||
rm -f $**.o
|
||||
|
||||
Reference in New Issue
Block a user