2021-12-10 07:31:09 +01:00
|
|
|
CC=g++
|
|
|
|
SRCDIR=./src
|
|
|
|
outputDir=./build
|
2022-01-25 18:31:28 +01:00
|
|
|
CFLAGS=-fPIC -O2 -g -std=c++11
|
2021-12-10 07:31:09 +01:00
|
|
|
WarningFlags=-Wpedantic -pedantic -Wall -Wextra
|
2021-12-31 04:52:13 +01:00
|
|
|
SDL_FLAGS=-lSDL2 -lSDL2main -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lSDL2_gfx
|
2021-12-10 07:31:09 +01:00
|
|
|
INCLUDES=-I./include
|
2022-01-17 03:22:43 +01:00
|
|
|
LIBFILE=libbirb2d.so
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2022-01-18 15:27:53 +01:00
|
|
|
all: test engine_lib
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2022-01-24 20:13:15 +01:00
|
|
|
docs:
|
|
|
|
doxygen ./doxygen_config
|
|
|
|
|
2022-01-25 18:31:28 +01:00
|
|
|
test: entity.o logger.o math.o renderwindow.o timer.o timestep.o utils.o values.o tests.o
|
2021-12-30 21:01:37 +01:00
|
|
|
mkdir -p build
|
2022-01-25 18:31:28 +01:00
|
|
|
$(CC) $^ $(CFLAGS) $(SDL_FLAGS) $(WarningFlags) -o $(outputDir)/test
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2021-12-30 21:01:37 +01:00
|
|
|
run_tests: test
|
|
|
|
./build/test
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2022-01-24 20:13:15 +01:00
|
|
|
engine_lib: audio.o entity.o logger.o math.o renderwindow.o physics.o timer.o timestep.o ui.o utils.o values.o
|
2022-01-17 03:22:43 +01:00
|
|
|
mkdir -p build
|
2022-01-24 20:13:15 +01:00
|
|
|
g++ -shared -g $(SDL_FLAGS) -o $(outputDir)/$(LIBFILE) $^
|
2022-01-17 03:22:43 +01:00
|
|
|
|
2022-01-24 20:13:15 +01:00
|
|
|
static_engine_lib: audio.o entity.o logger.o math.o renderwindow.o physics.o timer.o timestep.o ui.o utils.o values.o
|
2022-01-17 02:07:12 +01:00
|
|
|
mkdir -p build
|
2022-01-24 20:13:15 +01:00
|
|
|
g++ -static $(SDL_FLAGS) -o $(outputDir)/$(LIBFILE) $^
|
2022-01-17 03:22:43 +01:00
|
|
|
|
|
|
|
install: engine_lib
|
2022-01-18 15:27:53 +01:00
|
|
|
cp $(outputDir)/$(LIBFILE) /usr/lib/
|
2022-01-17 17:07:29 +01:00
|
|
|
mkdir -p /usr/local/include/birb2d
|
|
|
|
cp ./include/* /usr/local/include/birb2d/
|
2022-01-24 20:13:15 +01:00
|
|
|
ldconfig
|
2022-01-17 03:22:43 +01:00
|
|
|
|
|
|
|
uninstall:
|
2022-01-18 15:27:53 +01:00
|
|
|
rm -f /usr/lib/$(LIBFILE)
|
2022-01-17 03:22:43 +01:00
|
|
|
rm -rf /usr/local/include/birb2d
|
2022-01-24 20:13:15 +01:00
|
|
|
ldconfig
|
2021-12-31 21:44:19 +01:00
|
|
|
|
|
|
|
audio.o: $(SRCDIR)/audio.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $^ -o audio.o
|
2021-12-31 21:44:19 +01:00
|
|
|
|
2021-12-31 04:52:13 +01:00
|
|
|
entity.o: $(SRCDIR)/entity.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $^ -o entity.o
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2021-12-30 21:01:37 +01:00
|
|
|
logger.o: $(SRCDIR)/logger.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $^ -o logger.o
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2021-12-31 04:52:13 +01:00
|
|
|
tests.o: $(SRCDIR)/tests.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(SDL_FLAGS) $(WarningFlags) $^ -o tests.o
|
2021-12-31 04:52:13 +01:00
|
|
|
|
|
|
|
math.o: $(SRCDIR)/math.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(SDL_FLAGS) $(WarningFlags) $^ -o math.o
|
2021-12-31 04:52:13 +01:00
|
|
|
|
2021-12-30 21:01:37 +01:00
|
|
|
renderwindow.o: $(SRCDIR)/renderwindow.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o renderwindow.o
|
2021-12-31 04:52:13 +01:00
|
|
|
|
2022-01-18 20:32:04 +01:00
|
|
|
physics.o: $(SRCDIR)/physics.cpp
|
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o physics.o
|
|
|
|
|
2022-01-16 23:43:04 +01:00
|
|
|
timer.o: $(SRCDIR)/timer.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o timer.o
|
2022-01-16 23:43:04 +01:00
|
|
|
|
2021-12-31 04:52:13 +01:00
|
|
|
timestep.o: $(SRCDIR)/timestep.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o timestep.o
|
2021-12-31 04:52:13 +01:00
|
|
|
|
2022-01-24 20:13:15 +01:00
|
|
|
ui.o: $(SRCDIR)/ui.cpp
|
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o ui.o
|
|
|
|
|
2021-12-31 04:52:13 +01:00
|
|
|
utils.o: $(SRCDIR)/utils.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o utils.o
|
2021-12-10 07:31:09 +01:00
|
|
|
|
2021-12-30 21:01:37 +01:00
|
|
|
values.o: $(SRCDIR)/values.cpp
|
2022-01-17 03:22:43 +01:00
|
|
|
$(CC) -c $(CFLAGS) $(INCLUDES) $(WarningFlags) $^ -o values.o
|
2021-12-10 07:31:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-30 21:01:37 +01:00
|
|
|
.PHONY: clean
|
2021-12-10 07:31:09 +01:00
|
|
|
clean:
|
2021-12-30 21:01:37 +01:00
|
|
|
rm -f *.o log.txt
|
|
|
|
rm -rf $(outputDir)
|
2022-01-24 20:13:15 +01:00
|
|
|
rm -rf docs
|