Fix distribution of gnet-pcbfwd.scm in the dist tarball
[geda-pcb/gde.git] / src / Makefile.am
blob371173aa31182f9e8e300de201644083db89130d
1 ## -*- makefile -*-
2 ## $Id$
3 ##
5 SUBDIRS=        icons
7 pcbtreedir=     @PCBTREEDIR@
8 pcblibdir=      @PCBLIBDIR@
10 AUTOMAKE_OPTIONS = subdir-objects
11 HIDLIST = @HIDLIST@
12 noinst_LIBRARIES = @HIDLIBS@
13 EXTRA_LIBRARIES = \
14         libgtk.a liblesstif.a libbatch.a \
15         liblpr.a libgerber.a libbom.a libpng.a libps.a libnelma.a libgts.a
17 pcblib_DATA=    \
18         default_font \
19         gpcb-menu.res \
20         pcb-menu.res
22 bin_PROGRAMS=   pcb
24 if DEBUG_BUILD
25 # don't disable assert()
26 else
27 AM_CFLAGS = -DNDEBUG
28 endif
30 PCB_SRCS = \
31         action.c \
32         action.h \
33         autoplace.c \
34         autoplace.h \
35         autoroute.c \
36         autoroute.h \
37         box.h \
38         buffer.c \
39         buffer.h \
40         change.c \
41         change.h \
42         clip.c \
43         clip.h \
44         command.c \
45         command.h \
46         compat.c \
47         compat.h \
48         const.h \
49         copy.c \
50         copy.h \
51         create.c \
52         create.h \
53         crosshair.c \
54         crosshair.h \
55         data.c \
56         data.h \
57         djopt.c \
58         djopt.h \
59         dolists.h \
60         draw.c \
61         draw.h \
62         drill.c \
63         drill.h \
64         edif.y \
65         edif_parse.h \
66         error.c \
67         error.h \
68         file.c \
69         file.h \
70         find.c \
71         find.h \
72         flags.c \
73         fontmode.c \
74         global.h \
75         heap.c \
76         heap.h \
77         hid.h \
78         insert.c \
79         insert.h \
80         intersect.c \
81         intersect.h \
82         line.c \
83         line.h \
84         lrealpath.c \
85         lrealpath.h \
86         macro.h \
87         main.c \
88         mirror.c \
89         mirror.h \
90         misc.c \
91         misc.h \
92         move.c \
93         move.h \
94         mtspace.c \
95         mtspace.h \
96         mymem.c \
97         mymem.h \
98         netlist.c \
99         parse_l.h \
100         parse_l.l \
101         parse_y.h \
102         parse_y.y \
103         polygon.c \
104         polygon.h \
105         polygon1.c \
106         polyarea.h \
107         puller.c \
108         print.c \
109         print.h \
110         rats.c \
111         rats.h \
112         remove.c \
113         remove.h \
114         report.c \
115         report.h \
116         res_parse.y \
117         res_lex.l \
118         resource.h \
119         rotate.c \
120         rotate.h \
121         rtree.c \
122         rtree.h \
123         rubberband.c \
124         rubberband.h \
125         search.c \
126         search.h \
127         select.c \
128         select.h \
129         set.c \
130         set.h \
131         strflags.c \
132         strflags.h \
133         thermal.c \
134         thermal.h \
135         undo.c \
136         undo.h \
137         vector.c \
138         vector.h \
139         vendor.c \
140         vendor.h \
141         hid/common/actions.c \
142         hid/common/flags.c \
143         hid/common/hidinit.c \
144         hid/common/hidnogui.c \
145         hid/common/extents.c \
146         hid/common/draw_helpers.c \
147         hid/common/draw_helpers.h \
148         hid/common/hid_resource.c \
149         hid/common/hid_resource.h \
150         hid/hidint.h 
152 EXTRA_pcb_SOURCES = ${DBUS_SRCS} toporouter.c toporouter.h
153 DBUS_SRCS= \
154         dbus-pcbmain.c \
155         dbus-pcbmain.h \
156         dbus.h \
157         dbus.c
159 BUILT_SOURCES = \
160         core_lists.h \
161         gpcb-menu.h \
162         hid/gtk/gtk_lists.h \
163         hid/lesstif/lesstif_lists.h \
164         hid/batch/batch_lists.h \
165         hid/png/png_lists.h \
166         hid/nelma/nelma_lists.h \
167         hid/ps/ps_lists.h \
168         parse_y.h \
169         pcb-menu.h \
170         res_parse.h \
171         hid/common/hidlist.h
173 pcb_LDADD = @HIDLIBS@
174 pcb_DEPENDENCIES = @HIDLIBS@
176 if WITH_TOPOROUTER
177 PCB_SRCS += toporouter.c toporouter.h
178 noinst_LIBRARIES += libgts.a
179 pcb_LDADD += libgts.a
180 pcb_DEPENDENCIES += libgts.a
181 endif
183 pcb_SOURCES = ${PCB_SRCS} core_lists.h
185 # Action, Attribute, and Flag lists.
186 core_lists.h : ${PCB_SRCS} Makefile
187         true > $@
188         (for f in ${PCB_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
189         mv $@.tmp $@
191 # for globalconst.h
192 INCLUDES=       -I$(top_srcdir) -I$(srcdir)/icons -I$(srcdir)/gts
194 DEFS=   -DLOCALEDIR=\"$(localedir)\" @DEFS@
196 EXTRA_DIST= \
197         check_icon.data \
198         default_font \
199         $(srcdir)/hid/batch/hid.conf \
200         $(srcdir)/hid/bom/hid.conf \
201         $(srcdir)/hid/gerber/hid.conf \
202         $(srcdir)/hid/gtk/gui-icons-misc.data \
203         $(srcdir)/hid/gtk/gui-icons-mode-buttons.data \
204         $(srcdir)/hid/gtk/hid.conf \
205         $(srcdir)/hid/gtk/pcb.rc \
206         $(srcdir)/hid/lesstif/hid.conf \
207         $(srcdir)/hid/lpr/hid.conf \
208         $(srcdir)/hid/png/hid.conf \
209         $(srcdir)/hid/nelma/hid.conf \
210         $(srcdir)/hid/ps/hid.conf \
211         gpcb-menu.res \
212         pcb-menu.res \
213         pcbtest.sh.in \
214         dbus.xml
216 AM_YFLAGS=      -d
218 all-local: pcbtest.sh
220 pcb-menu.h : pcb-menu.res
221         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@
222         echo 'const char *pcb_menu_default[] = {' >> $@
223         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < ${srcdir}/pcb-menu.res >> $@
224         echo '0};' >> $@
226 gpcb-menu.h : gpcb-menu.res
227         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@
228         echo 'const char *gpcb_menu_default[] = {' >> $@
229         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < ${srcdir}/gpcb-menu.res >> $@
230         echo '0};' >> $@
232 hid/common/hidlist.h : Makefile
233         true > $@
234         for e in ${HIDLIST}; do \
235           echo "HID_DEF($${e})" >> $@; \
236         done
238 libgtk_a_CPPFLAGS = -I./hid/gtk
239 LIBGTK_SRCS = \
240         dolists.h \
241         hid/hidint.h \
242         hid/gtk/gtkhid-main.c \
243         hid/gtk/gtkhid-gdk.c \
244         hid/gtk/gtkhid.h \
245         hid/gtk/gui.h \
246         hid/gtk/gui-command-window.c \
247         hid/gtk/gui-config.c \
248         hid/gtk/gui-dialog-print.c \
249         hid/gtk/gui-dialog-size.c \
250         hid/gtk/gui-dialog.c \
251         hid/gtk/gui-drc-window.c \
252         hid/gtk/gui-drc-window.h \
253         hid/gtk/gui-keyref-window.c \
254         hid/gtk/gui-library-window.c \
255         hid/gtk/gui-library-window.h \
256         hid/gtk/gui-log-window.c \
257         hid/gtk/gui-misc.c \
258         hid/gtk/gui-netlist-window.c \
259         hid/gtk/gui-output-events.c \
260         hid/gtk/gui-pinout-preview.c \
261         hid/gtk/gui-pinout-preview.h \
262         hid/gtk/gui-pinout-window.c \
263         hid/gtk/gui-render-pixmap.c \
264         hid/gtk/gui-top-window.c \
265         hid/gtk/gui-utils.c
266 libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h
268 hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile
269         true > $@
270         (for f in ${LIBGTK_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
271         mv $@.tmp $@
273 # If we are building with dbus support, we need some extra files
274 if WITH_DBUS
275 dbus-introspect.h : dbus.xml Makefile
276         echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp
277         echo "static char *pcb_dbus_introspect_xml ="  > $@.tmp
278         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp
279         echo ";" >> $@.tmp
280         mv $@.tmp $@
282 PCB_SRCS+=      ${DBUS_SRCS}
283 BUILT_SOURCES+= dbus-introspect.h
285 endif
287 # If we are building on win32, then compile in some icons for the
288 # desktop and application toolbar
289 if WIN32
290 pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc
291         $(WINDRES) $(srcdir)/hid/gtk/pcb.rc $@
293 pcb_icon.ico: $(top_srcdir)/data/pcb_icon.ico
294         cp $(top_srcdir)/data/pcb_icon.ico $@
296 pcb_LDADD+=                     pcb_icon.o
297 pcb_DEPENDENCIES+=      pcb_icon.o
299 endif
302 liblesstif_a_CPPFLAGS = -I./hid/lesstif
303 LIBLESSTIF_SRCS = \
304         dolists.h \
305         hid/hidint.h \
306         hid/lesstif/dialogs.c \
307         hid/lesstif/lesstif.h \
308         hid/lesstif/library.c \
309         hid/lesstif/main.c \
310         hid/lesstif/menu.c \
311         hid/lesstif/netlist.c \
312         hid/lesstif/styles.c \
313         hid/lesstif/xincludes.h 
314 liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h
316 hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile
317         true > $@
318         (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
319         mv $@.tmp $@
321 libgts_a_CPPFLAGS = -I./gts
322 LIBGTS_SRCS = \
323         gts/object.c \
324         gts/point.c \
325         gts/vertex.c \
326         gts/segment.c \
327         gts/edge.c \
328         gts/triangle.c \
329         gts/face.c \
330         gts/kdtree.c \
331         gts/bbtree.c \
332         gts/misc.c \
333         gts/gts-private.h \
334         gts/predicates.c \
335         gts/predicates.h \
336         gts/rounding.h \
337         gts/heap.c \
338         gts/eheap.c \
339         gts/fifo.c \
340         gts/gts.h \
341         gts/matrix.c \
342         gts/surface.c \
343         gts/stripe.c \
344         gts/vopt.c \
345         gts/refine.c \
346         gts/iso.c \
347         gts/isotetra.c \
348         gts/split.c \
349         gts/psurface.c \
350         gts/hsurface.c \
351         gts/cdt.c \
352         gts/boolean.c \
353         gts/named.c \
354         gts/oocs.c \
355         gts/container.c \
356         gts/graph.c \
357         gts/pgraph.c \
358         gts/partition.c \
359         gts/curvature.c \
360         gts/tribox3.c
361 libgts_a_SOURCES = ${LIBGTS_SRCS} gts/gts_lists.h
363 gts/gts_lists.h : ${LIBGTS_SRCS} Makefile
364         true > $@
365 # Uncomment out the following if/when we ever end up with REGISTER in any of the gts
366 # source files.  For now, there aren't any and so the grep fails and make stops
367 #       (for f in ${LIBGTS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
368 #       mv $@.tmp $@
370 libbatch_a_CPPFLAGS = -I./hid/batch
371 LIBBATCH_SRCS = \
372         hid/hidint.h \
373         hid/batch/batch.c 
374 libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h
376 hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile
377         true > $@
378         (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
379         mv $@.tmp $@
381 libgerber_a_SOURCES = \
382         hid/hidint.h \
383         hid/gerber/gerber.c
385 libbom_a_SOURCES = \
386         hid/hidint.h \
387         hid/bom/bom.c
389 libps_a_CPPFLAGS = -I./hid/ps
390 LIBPS_SRCS = \
391         dolists.h \
392         hid/hidint.h \
393         hid/ps/ps.c \
394         hid/ps/ps.h \
395         hid/ps/eps.c 
396 libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h
398 hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile
399         true > $@
400         (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
401         mv $@.tmp $@
403 libpng_a_CPPFLAGS = -I./hid/png
404 LIBPNG_SRCS = \
405         dolists.h \
406         hid/hidint.h \
407         hid/png/png.c \
408         hid/png/png.h 
409 libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h
411 hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile
412         true > $@
413         (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
414         mv $@.tmp $@
416 libnelma_a_CPPFLAGS = -I./hid/nelma
417 LIBNELMA_SRCS = \
418         dolists.h \
419         hid/hidint.h \
420         hid/nelma/nelma.c \
421         hid/nelma/nelma.h 
422 libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h
424 hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile
425         true > $@
426         (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
427         mv $@.tmp $@
429 liblpr_a_SOURCES = \
430         hid/hidint.h \
431         hid/lpr/lpr.c
433 DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \
434         hid/batch/batch_lists.h \
435         hid/common/hidlist.h \
436         hid/gtk/gtk_lists.h \
437         hid/lesstif/lesstif_lists.h \
438         hid/png/png_lists.h \
439         hid/nelma/nelma_lists.h \
440         hid/ps/ps_lists.h \
441         gts/gts_lists.h \
442         core_lists.h \
443         dbus-introspect.h
445 # create wrapper script that lets you test pcb prior to installation
446 pcbtest.sh:     $(srcdir)/pcbtest.sh.in Makefile
447         sed -e 's;@BUILDDIR@;${abs_builddir};g' -e 's;@TOP_BUILDDIR@;${abs_top_builddir};g' \
448                 -e 's;@TOPSRCDIR@;${abs_top_srcdir};g' \
449                 $(srcdir)/pcbtest.sh.in > $@
450         chmod 755 $@