-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (36 loc) · 830 Bytes
/
Copy pathMakefile
File metadata and controls
52 lines (36 loc) · 830 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CC:=gcc -std=c99
AR:=ar
CFLAG:=-O3 -I. -fPIC -DNDEBUG -DVL_HIGHP
ifeq ($(OS), Windows_NT)
SEP:=\\
DYNAMIC:=.$(SEP)voxelizer.dll
STATIC:=.$(SEP)voxelizer.lib
EXAMPLE:=.$(SEP)example.exe
DEL:=cmd /c del
else
SEP:=/
DYNAMIC:=.$(SEP)libvoxelizer.so
STATIC:=.$(SEP)libvoxelizer.a
EXAMPLE:=.$(SEP)example.out
DEL:=rm
endif
all: $(DYNAMIC) $(STATIC) $(EXAMPLE)
voxelizer.o: voxelizer.c
$(CC) -c $^ $(CFLAG)
$(DYNAMIC): voxelizer.o
$(CC) -shared -o $@ $^
$(STATIC): voxelizer.o
$(AR) crv $@ $^
$(EXAMPLE): example/example.c voxelizer.c
$(CC) -o $@ $^ $(CFLAG) -DVL_TEST
run: $(EXAMPLE) $(DYNAMIC)
@echo "---- Binary ----"
$(EXAMPLE)
@echo "---- Python ----"
python .$(SEP)example$(SEP)example.py
clean:
$(DEL) $(EXAMPLE)
$(DEL) $(DYNAMIC)
$(DEL) $(STATIC)
.PHONY: run clean
.INTERMEDIATE: voxelizer.o