Skip to content

Commit f2472d5

Browse files
committed
Added makefile to build bitmap2component and the dist zip
1 parent 03562a3 commit f2472d5

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
CXX=g++
2+
CXXFLAGS=-std=c++11
3+
INCLUDES=-Iinclude -Ipolygon -Ipotrace -Isrc
4+
LIBS=
5+
6+
SOURCES:=\
7+
common/geometry/seg.cpp \
8+
common/geometry/shape_collisions.cpp \
9+
common/geometry/shape.cpp \
10+
common/geometry/shape_line_chain.cpp \
11+
common/geometry/shape_poly_set.cpp \
12+
common/math/math_util.cpp \
13+
polygon/clipper.cpp \
14+
src/main.cpp \
15+
src/bitmap2component.cpp \
16+
src/lodepng.cpp \
17+
potrace/curve.cpp \
18+
potrace/decompose.cpp \
19+
potrace/potracelib.cpp \
20+
potrace/trace.cpp
21+
OBJECTS:=$(patsubst %.cpp,%.o,$(SOURCES))
22+
23+
ifneq ($(OS),Windows_NT)
24+
OS:=$(shell uname)
25+
endif
26+
ifeq ($(OS), Windows_NT)
27+
EXESUFFIX=.exe
28+
endif
29+
30+
BITMAP2COMPONENT:=bitmap2component$(EXESUFFIX)
31+
GIT_TAG_VERSION=$(shell git describe --tag)
32+
RELEASE_FILENAME_PREFIX=svg2shenzhen-extension
33+
DIST:=$(RELEASE_FILENAME_PREFIX)-$(GIT_TAG_VERSION).zip
34+
35+
.PHONY: clean all package
36+
37+
all: $(BITMAP2COMPONENT)
38+
39+
package: $(DIST)
40+
41+
clean:
42+
rm -f *.o common/geometry/*.p common/math/*.o polygon/*.o src/*.o potrace/*.o $(BITMAP2COMPONENT) $(DIST)
43+
44+
%.o: %.cpp
45+
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
46+
47+
$(BITMAP2COMPONENT): $(OBJECTS)
48+
$(CXX) $(LIBS) $^ -o $@
49+
50+
$(DIST):
51+
zip $@ inkscape/svg2shenzhen/
52+
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_about.inx | zip -q $@ -
53+
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_about.inx' | zipnote -w $@
54+
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_export.inx | zip -q $@ -
55+
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_export.inx' | zipnote -w $@
56+
sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_prepare.inx | zip -q $@ -
57+
/bin/echo -e '@ -\n@=inkscape/svg2shenzhen_prepare.inx' | zipnote -w $@

0 commit comments

Comments
 (0)