Debian Codegraph @

Makefile

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1
2 all: cfdg
3
4
5 #
6 # Dirs
7 #
8
9 OBJ_DIR = objs
10
11 COMMON_DIR = src-common
12 UNIX_DIR = src-unix
13 DERIVED_DIR = $(OBJ_DIR)
14 AGG_DIR = src-agg
15 FFMPEG_DIR = src-ffmpeg
16
17 SRC_DIRS = $(COMMON_DIR) $(UNIX_DIR) $(DERIVED_DIR) $(AGG_DIR)/src
18 vpath %.cpp $(SRC_DIRS)
19 vpath %.cfdg input
20
21 INC_DIRS = $(COMMON_DIR) $(UNIX_DIR) $(DERIVED_DIR) $(COMMON_DIR)/agg-extras
22 INC_DIRS += /usr/local/include
23
24 #
25 # Installation directories
26 #
27
28 prefix = /usr/local
29
30 BIN_DIR = $(DESTDIR)$(prefix)/bin
31 MAN_DIR = $(DESTDIR)$(prefix)/share/man
32
33 #
34 # Library directories for FFmpeg and libpng
35 #
36
37 LIB_DIRS = /usr/local/lib
38
39 #
40 # Sources and Objects
41 #
42
43 COMMON_SRCS = cfdg.cpp Rand64.cpp makeCFfilename.cpp \
44 cfdgimpl.cpp renderimpl.cpp builder.cpp shape.cpp \
45 variation.cpp tempfile.cpp commandLineSystem.cpp \
46 aggCanvas.cpp HSBColor.cpp SVGCanvas.cpp rendererAST.cpp \
47 primShape.cpp bounds.cpp shape.cpp shapeSTL.cpp tiledCanvas.cpp \
48 astexpression.cpp astreplacement.cpp pathIterator.cpp \
49 stacktype.cpp CmdInfo.cpp abstractPngCanvas.cpp ast.cpp \
50 prettyint.cpp
51
52 UNIX_SRCS = pngCanvas.cpp posixSystem.cpp main.cpp posixTimer.cpp \
53 posixVersion.cpp
54
55 DERIVED_SRCS = cfdg.tab.cpp lex.yy.cpp
56
57 AGG_SRCS = agg_trans_affine.cpp agg_curves.cpp agg_vcgen_contour.cpp \
58 agg_vcgen_stroke.cpp agg_bezier_arc.cpp agg_color_rgba.cpp
59
60 INPUT_SRCS = ciliasun_v2.cfdg demo1_v2.cfdg demo2_v2.cfdg funky_flower_v2.cfdg \
61 i_curves_v2.cfdg i_pix_v2.cfdg i_polygons_v2.cfdg lesson2_v2.cfdg \
62 lesson_v2.cfdg mtree_v2.cfdg octopi_v2.cfdg quadcity_v2.cfdg rose_v2.cfdg \
63 sierpinski_v2.cfdg snowflake_v2.cfdg tangle_v2.cfdg triples_v2.cfdg \
64 underground_v2.cfdg weighting_demo_v2.cfdg welcome_v2.cfdg ziggy_v2.cfdg \
65 ciliasun.cfdg demo1.cfdg demo2.cfdg funky_flower.cfdg i_curves.cfdg \
66 i_pix.cfdg i_polygons.cfdg lesson2.cfdg lesson.cfdg mtree.cfdg \
67 octopi.cfdg quadcity.cfdg rose.cfdg sierpinski.cfdg snowflake.cfdg \
68 tangle.cfdg triples.cfdg underground.cfdg weighting_demo.cfdg \
69 welcome.cfdg ziggy.cfdg
70
71
72 LIBS = png m
73
74 # Use the first one for clang and the second one for gcc
75 ifeq ($(shell uname -s), Darwin)
76 LIBS += c++ icucore
77 else
78 LIBS += stdc++ atomic icui18n icuuc icudata
79 endif
80
81 #
82 # FFmpeg support
83 #
84 # Uncomment these lines to enable FFmpeg support
85 #
86
87 # COMMON_SRCS += ffCanvas.cpp
88 # LIBS += avformat avcodec swscale swresample avutil z m x264 pthread dl
89
90 #
91 # Comment out this line to enable FFmpeg support
92 #
93
94 COMMON_SRCS += ffCanvasDummy.cpp
95
96 SRCS = $(DERIVED_SRCS) $(COMMON_SRCS) $(UNIX_SRCS)
97
98 #
99 # Configuration for local AGG
100 #
101 SRCS += $(AGG_SRCS)
102 INC_DIRS += $(AGG_DIR) $(AGG_DIR)/agg2
103
104
105 #
106 # Configuration for system AGG
107 #
108 #LIBS += agg
109
110
111 OBJS = $(patsubst %.cpp,$(OBJ_DIR)/%.o,$(SRCS))
112 DEPS = $(patsubst %.o,%.d,$(OBJS))
113
114 LINKFLAGS += $(patsubst %,-L%,$(LIB_DIRS))
115 LINKFLAGS += $(patsubst %,-l%,$(LIBS))
116 LINKFLAGS += -fexceptions
117
118 deps: $(OBJ_DIR) $(DEPS)
119
120 ifneq ($(MAKECMDGOALS),clean)
121 ifneq ($(MAKECMDGOALS),distclean)
122 ifneq ($(MAKECMDGOALS),src-common/examples.h)
123 include $(DEPS)
124 endif
125 endif
126 endif
127
128 $(OBJS): $(OBJ_DIR)/Sentry
129
130 #
131 # Executable
132 #
133 # Under Cygwin replace strip $@ with strip [email protected]
134
135 cfdg: $(OBJS)
136 $(LINK.o) $^ $(LINKFLAGS) -o $@
137 strip $@
138
139
140 #
141 # Derived
142 #
143
144 $(DERIVED_DIR)/lex.yy.cpp: $(COMMON_DIR)/cfdg.l
145 flex -o $@ $^
146
147 $(DERIVED_DIR)/cfdg.tab.hpp: $(DERIVED_DIR)/cfdg.tab.cpp
148 $(DERIVED_DIR)/location.hh: $(DERIVED_DIR)/cfdg.tab.cpp
149 $(DERIVED_DIR)/cfdg.tab.cpp: $(COMMON_DIR)/cfdg.ypp $(OBJ_DIR)/Sentry
150 bison -o $(DERIVED_DIR)/cfdg.tab.cpp $(COMMON_DIR)/cfdg.ypp
151
152 $(OBJ_DIR)/lex.yy.o: $(DERIVED_DIR)/cfdg.tab.hpp
153
154 src-common/examples.h: $(INPUT_SRCS)
155 python3 makeexamples.py $(INPUT_SRCS) > src-common/examples.h
156
157 #
158 # Utility
159 #
160
161 .PHONY: clean distclean install uninstall
162 clean :
163 rm -f $(OBJ_DIR)/*
164 rm -f cfdg
165
166 distclean: clean
167 rmdir $(OBJ_DIR) 2> /dev/null || true
168 rm -fr output 2> /dev/null || true
169
170 $(OBJ_DIR)/Sentry :
171 mkdir -p $(OBJ_DIR) 2> /dev/null || true
172 touch $@
173
174 install: cfdg cfdg.1
175 install -d $(BIN_DIR) $(MAN_DIR)/man1
176 install -m 755 cfdg $(BIN_DIR)
177 install -m 644 cfdg.1 $(MAN_DIR)/man1
178
179 uninstall:
180 -rm -f $(BIN_DIR)/cfdg
181 -rm -f $(MAN_DIR)/man1/cfdg.1
182
183 #
184 # Tests
185 #
186
187 .PHONY: test check
188 test: cfdg
189 ./runtests.sh
190
191 check: cfdg
192 ./runtests.sh
193
194 #
195 # Rules
196 #
197
198 CXXFLAGS += $(patsubst %,-I%,$(INC_DIRS))
199 CXXFLAGS += -O2 -Wall -Wextra -Wno-parentheses -std=c++17
200 CXXFLAGS += -g -D_GLIBCXX_USE_C99_MATH=1
201 CPPFLAGS += -DNDEBUG
202
203 # Add this for clang
204 ifeq ($(shell uname -s), Darwin)
205 CXXFLAGS += -stdlib=libc++
206
207 # Uncomment this line to enable FFmpeg support on macos
208 # LDFLAGS += -framework CoreFoundation -framework CoreVideo -framework CoreMedia -framework VideoToolbox
209 endif
210
211 $(OBJ_DIR)/%.o : %.cpp
212 $(COMPILE.cpp) $(OUTPUT_OPTION) $<
213
214 $(OBJ_DIR)/%.d : %.cpp $(OBJ_DIR)/location.hh
215 mkdir -p $(OBJ_DIR) 2> /dev/null || true
216 set -e; $(COMPILE.cpp) -MM $< \
217 | sed 's,\(.*\.o\)\( *:\),$(OBJ_DIR)/\1 $@\2,g' > $@; \
218 [ -s $@ ] || rm -f $@
219
220 $(OBJ_DIR)/cfdg.tab.d:
221 mkdir -p $(OBJ_DIR) 2> /dev/null || true
222
223 $(OBJ_DIR)/lex.yy.d:
224 mkdir -p $(OBJ_DIR) 2> /dev/null || true
225