-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
21 lines (16 loc) · 784 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CXXFLAGS = -fPIC -g -W -Wall -Wextra -Werror=return-type -std=c++2a `pkg-config --cflags glfw3 gl glew libpng`
LIBFLAGS = `pkg-config --libs glfw3 glew gl libpng`
OBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
DEMOS = $(patsubst %.cpp,%,$(wildcard demos/*.cpp))
GEOMS = $(patsubst %.cpp,%.o,$(wildcard geometrie/*.cpp))
all: gereedschap $(DEMOS)
gereedschap: $(OBJECTS) $(GEOMS)
mkdir -p bin
g++ -shared $(CXXFLAGS) -o bin/libgereedschap.so $(OBJECTS) $(GEOMS) $(LIBFLAGS)
ar rcs libgereedschap.a $(OBJECTS) $(GEOMS)
$(DEMOS): gereedschap $(wildcard demos/*.cpp)
g++ $(CXXFLAGS) -o $(patsubst demos/%,bin/%,$@) [email protected] $(OBJECTS) $(GEOMS) $(LIBFLAGS) -L. -lgereedschap
%.o: %.cpp geometrie/%.cpp
g++ $(CXXFLAGS) -c -o $@ $<
clean:
rm $(OBJECTS) $(GEOMS) bin/* *.a