-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
38 lines (27 loc) · 1002 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
35
36
37
38
LUAINC=-I /usr/local/include
LUALIB=-L /usr/local/bin -L$(MINGW)/bin -llua54
GLM_INC = -I glm
ODIR = o
CFLAGS = -O2 -Wall
OUTPUT=./
.PHONY : all test
all : $(OUTPUT)math3d.dll
test : mathid_test.exe
$(ODIR)/mathid.o : mathid.c | $(ODIR)
$(CC) -c $(CFLAGS) -o $@ $^ $(LUAINC)
$(ODIR)/math3d.o : math3d.c | $(ODIR)
$(CC) -c $(CFLAGS) -o $@ $^ $(LUAINC)
$(ODIR)/math3dfunc.o : math3dfunc.cpp | $(ODIR)
$(CXX) -c $(CFLAGS) -Wno-char-subscripts -o $@ -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_QUAT_DATA_XYZW $^ $(GLM_INC)
$(ODIR)/mathadapter.o : mathadapter.c | $(ODIR)
$(CC) -c $(CFLAGS) -o $@ $^ $(LUAINC)
$(ODIR)/testadapter.o : testadapter.c | $(ODIR)
$(CC) -c $(CFLAGS) -o $@ $^ $(LUAINC)
$(OUTPUT)math3d.dll : $(ODIR)/mathid.o $(ODIR)/math3d.o $(ODIR)/math3dfunc.o $(ODIR)/mathadapter.o $(ODIR)/testadapter.o
$(CXX) --shared $(CFLAGS) -o $@ $^ -lstdc++ $(LUALIB)
$(ODIR) :
mkdir -p $@
clean :
rm -rf $(ODIR) *.dll *.exe
mathid_test.exe : mathid.c
$(CC) $(CFLAGS) -DTEST_MATHID -o $@ $^