-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (48 loc) · 1.74 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
include Makefile.SUPPORTED
ifeq (,$(findstring $(OS),$(SUPPORTEDPLATFORMS)))
all:
@echo The OS environment variable is currently set to [$(OS)]
@echo Please set the OS environment variable to one of the following:
@echo $(SUPPORTEDPLATFORMS)
.PHONY: all
else
include Makefile.$(OS)
OPTIONS=-DSTLIO_VERTEX_NORMAL_VALIDATION_ENABLED -DSTLIO_ERROR_STRINGS_ENABLED -DSTLIO_VALIDATION_SOLIDNAME_MATCH_ENABLED
LIBSRCFILES=../src/stlio.c ../src/stlioErrorStrings.c
OBJFILES=tmp/stlio$(OBJSUFFIX) \
tmp/stlioErrorStrings$(OBJSUFFIX)
all: staticLib dynamicLib tests tools
staticLib: $(OBJFILES)
$(ARCMD) bin/libstlio$(SLIBSUFFIX) $(OBJFILES)
dynamicLib: $(OBJFILES)
$(SHAREDCC) $(OPTIONS) -o bin/libstlio$(DYNLIBSUFFIX) $(OBJFILES)
package: staticLib dynamicLib tests tools
# Create staging hierarchy
$(MKDIR) stage/lib
$(MKDIR) stage/bin
$(MKDIR) packages
# Copy files
$(CP) bin/libstlio$(SLIBSUFFIX) stage/lib/libstlio$(SLIBSUFFIX)
$(CP) bin/libstlio$(DYNLIBSUFFIX) stage/lib/libstlio$(DYNLIBSUFFIX)
$(CP) bin/tools/stl2bin$(EXESUFFIX) stage/bin/stl2bin$(EXESUFFIX)
$(CP) bin/tools/stl2ascii$(EXESUFFIX) stage/bin/stl2ascii$(EXESUFFIX)
# Create archive
$(MKSTAGEARCHIVE)
# Cleanup
$(RMDIR) stage
tmp/stlio$(OBJSUFFIX): src/stlio.c include/serdeshelper.h include/stlio.h
$(CCLIB) $(OPTIONS) -c -o tmp/stlio$(OBJSUFFIX) src/stlio.c
tmp/stlioErrorStrings$(OBJSUFFIX): src/stlioErrorStrings.c include/stlio.h
$(CCLIB) $(OPTIONS) -c -o tmp/stlioErrorStrings$(OBJSUFFIX) src/stlioErrorStrings.c
tests:
- @$(MAKE) -C ./tests
tools:
@echo Building tools
- @$(MAKE) -C ./tools
clean:
- @$(RMFILE) bin/test*
- @$(RMFILE) bin/lib*
- @$(RMFILE) bin/tools/stl*
- @$(RMFILE) tmp/*$(OBJSUFFIX)
.PHONY: staticLib dynamicLib tests tools clean
endif