summaryrefslogtreecommitdiffstats
path: root/makefile
blob: ed5420a722d793e410935207d0fe19d4463ef42c (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
# Compiler
CPP    := c++
CFLAGS := -Wall -pedantic -std=c++17 -fPIC -shared -I include -DDEBUG -DWRAPSDL2_EXCEPTIONS
LFLAGS := -lSDL2

SRCS := $(wildcard *.cpp)
OBJS := $(patsubst %.cpp,build/%.o,$(SRCS))

# Recipes
all: build/libwrapsdl2.so
	$(MAKE) -C test

.PHONY: test-all
.ONESHELL:
test-all:
	cd test
	./build/window_test
    

build/libwrapsdl2.so: $(OBJS)
	$(CPP) $(CFLAGS) -o $@ $(LFLAGS) $(OBJS)

build/%.o: %.cpp build
	$(CPP) $(CFLAGS) -o $@ -c $<

build:
	mkdir -p build