-
Notifications
You must be signed in to change notification settings - Fork 79
/
Makefile
57 lines (47 loc) · 1.61 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
CXX=g++
CXXFLAGS=-std=c++11
INCLUDES=-Iinclude -Ipolygon -Ipotrace -Isrc -I./ -IC:\MinGW\include
LIBS=
SOURCES:=\
common/geometry/seg.cpp \
common/geometry/shape_collisions.cpp \
common/geometry/shape.cpp \
common/geometry/shape_line_chain.cpp \
common/geometry/shape_poly_set.cpp \
common/math/math_util.cpp \
polygon/clipper.cpp \
src/main.cpp \
src/bitmap2component.cpp \
src/lodepng.cpp \
potrace/curve.cpp \
potrace/decompose.cpp \
potrace/potracelib.cpp \
potrace/trace.cpp
OBJECTS:=$(patsubst %.cpp,%.o,$(SOURCES))
ifneq ($(OS),Windows_NT)
OS:=$(shell uname)
endif
ifeq ($(OS), Windows_NT)
EXESUFFIX=.exe
endif
BITMAP2COMPONENT:=bitmap2component$(EXESUFFIX)
GIT_TAG_VERSION=$(shell git describe --tag)
RELEASE_FILENAME_PREFIX=svg2shenzhen-extension
DIST:=$(RELEASE_FILENAME_PREFIX)-$(GIT_TAG_VERSION).zip
.PHONY: clean all package
all: $(BITMAP2COMPONENT)
package: $(DIST)
clean:
rm -f *.o common/geometry/*.p common/math/*.o polygon/*.o src/*.o potrace/*.o $(BITMAP2COMPONENT) $(DIST)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(BITMAP2COMPONENT): $(OBJECTS)
$(CXX) $(LIBS) $^ -o $@
$(DIST):
zip $@ inkscape/svg2shenzhen/
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_about.inx | zip -q $@ -
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_about.inx' | zipnote -w $@
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_export.inx | zip -q $@ -
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_export.inx' | zipnote -w $@
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_prepare.inx | zip -q $@ -
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_prepare.inx' | zipnote -w $@