Revert "Remove GTS sources in favour of the libgts package."
[geda-pcb/pcjc2.git] / src / Makefile.am
blob3fc265b39621d8ed12bde22704dccf104a6084be
1 ## -*- makefile -*-
3 SUBDIRS=        icons
5 CC = @CC_OR_CXX@
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 \
16         libgcode.a libipcd356.a
18 pcblib_DATA= \
19         default_font \
20         gpcb-menu.res \
21         pcb-menu.res
23 bin_PROGRAMS=   pcb
25 if DEBUG_BUILD
26 # don't disable assert()
27 else
28 AM_CFLAGS= -DNDEBUG
29 endif
31 PCB_SRCS = \
32         action.c \
33         action.h \
34         autoplace.c \
35         autoplace.h \
36         autoroute.c \
37         autoroute.h \
38         box.h \
39         buffer.c \
40         buffer.h \
41         change.c \
42         change.h \
43         clip.c \
44         clip.h \
45         compat.c \
46         compat.h \
47         const.h \
48         copy.c \
49         copy.h \
50         create.c \
51         create.h \
52         crosshair.c \
53         crosshair.h \
54         data.c \
55         data.h \
56         djopt.c \
57         djopt.h \
58         dolists.h \
59         draw.c \
60         draw.h \
61         drill.c \
62         drill.h \
63         edif.y \
64         edif_parse.h \
65         error.c \
66         error.h \
67         file.c \
68         file.h \
69         find.c \
70         find.h \
71         flags.c \
72         fontmode.c \
73         free_atexit.c \
74         free_atexit.h \
75         gettext.h \
76         global.h \
77         heap.c \
78         heap.h \
79         hid.h \
80         hid_draw.h \
81         insert.c \
82         insert.h \
83         intersect.c \
84         intersect.h \
85         layerflags.c \
86         layerflags.h \
87         line.c \
88         line.h \
89         lrealpath.c \
90         lrealpath.h \
91         macro.h \
92         main.c \
93         mirror.c \
94         mirror.h \
95         misc.c \
96         misc.h \
97         move.c \
98         move.h \
99         mtspace.c \
100         mtspace.h \
101         mymem.c \
102         mymem.h \
103         netlist.c \
104         parse_l.h \
105         parse_l.l \
106         parse_y.y \
107         pcb-printf.c \
108         pcb-printf.h \
109         polygon.c \
110         polygon.h \
111         polygon1.c \
112         polyarea.h \
113         puller.c \
114         print.c \
115         print.h \
116         rats.c \
117         rats.h \
118         relocate.c \
119         remove.c \
120         remove.h \
121         renumber.c \
122         report.c \
123         report.h \
124         res_parse.y \
125         res_lex.l \
126         resource.h \
127         rotate.c \
128         rotate.h \
129         rtree.c \
130         rtree.h \
131         rubberband.c \
132         rubberband.h \
133         search.c \
134         search.h \
135         select.c \
136         select.h \
137         set.c \
138         set.h \
139         smartdisperse.c \
140         strflags.c \
141         strflags.h \
142         teardrops.c \
143         thermal.c \
144         thermal.h \
145         undo.c \
146         undo.h \
147         vector.c \
148         vector.h \
149         vendor.c \
150         vendor.h \
151         hid/common/actions.c \
152         hid/common/actions.h \
153         hid/common/flags.c \
154         hid/common/hidinit.c \
155         hid/common/hidinit.h \
156         hid/common/hidnogui.c \
157         hid/common/hidnogui.h \
158         hid/common/extents.c \
159         hid/common/draw_helpers.c \
160         hid/common/draw_helpers.h \
161         hid/common/hid_resource.c \
162         hid/common/hid_resource.h \
163         hid/hidint.h 
165 EXTRA_pcb_SOURCES = ${DBUS_SRCS} ${GL_SRCS} toporouter.c toporouter.h
166 DBUS_SRCS= \
167         dbus-pcbmain.c \
168         dbus-pcbmain.h \
169         dbus.h \
170         dbus.c
172 LIBGTK_GDK_SRCS= \
173         hid/gtk/gtkhid-gdk.c
175 LIBGTK_GL_SRCS= \
176         hid/gtk/gtkhid-gl.c \
177         hid/gtk/gui-trackball.c \
178         hid/gtk/gui-trackball.h
180 GL_SRCS= \
181         hid/common/hidgl.c \
182         hid/common/hidgl.h \
183         hid/common/trackball.c \
184         hid/common/trackball.h
186 BUILT_SOURCES = \
187         core_lists.h \
188         gpcb-menu.h \
189         hid/gtk/gtk_lists.h \
190         hid/lesstif/lesstif_lists.h \
191         hid/batch/batch_lists.h \
192         hid/png/png_lists.h \
193         hid/gcode/gcode_lists.h \
194         hid/nelma/nelma_lists.h \
195         hid/ps/ps_lists.h \
196         parse_y.h \
197         pcb-menu.h \
198         res_parse.h \
199         hid/common/hidlist.h
201 pcb_LDADD = @HIDLIBS@
202 pcb_DEPENDENCIES = @HIDLIBS@
204 if WITH_TOPOROUTER
205 PCB_SRCS += toporouter.c toporouter.h
206 pcb_LDADD += ../gts/libgts.a
207 pcb_DEPENDENCIES += ../gts/libgts.a
208 endif
210 # All these -I$(top_srcdir) in this file are for globalconst.h.
211 pcb_CPPFLAGS = -I$(top_srcdir)
212 pcb_SOURCES = ${PCB_SRCS} core_lists.h
214 TEST_SRCS = \
215         pcb-printf.c    \
216         main-test.c
218 unittest_CPPFLAGS = -I$(top_srcdir) -DPCB_UNIT_TEST
219 unittest_SOURCES = ${TEST_SRCS}
220 check_PROGRAMS = unittest
221 check_SCRIPTS = unittest
222 TESTS = unittest
224 # Action, Attribute, and Flag lists.
225 core_lists.h : ${PCB_SRCS} Makefile
226         true > $@
227         (for f in ${PCB_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
228         mv $@.tmp $@
230 # for globalconst.h
231 INCLUDES=       -I$(top_srcdir) -I$(srcdir)/icons -I$(srcdir)/../gts
233 DEFS=   -DLOCALEDIR=\"$(localedir)\" @DEFS@
235 EXTRA_DIST= \
236         check_icon.data \
237         default_font \
238         $(srcdir)/hid/batch/hid.conf \
239         $(srcdir)/hid/bom/hid.conf \
240         $(srcdir)/hid/gcode/hid.conf \
241         $(srcdir)/hid/gerber/hid.conf \
242         $(srcdir)/hid/gtk/gui-icons-misc.data \
243         $(srcdir)/hid/gtk/gui-icons-mode-buttons.data \
244         $(srcdir)/hid/gtk/hid.conf \
245         $(srcdir)/hid/gtk/pcb.rc \
246         $(srcdir)/hid/ipcd356/hid.conf \
247         $(srcdir)/hid/lesstif/hid.conf \
248         $(srcdir)/hid/lpr/hid.conf \
249         $(srcdir)/hid/png/hid.conf \
250         $(srcdir)/hid/nelma/hid.conf \
251         $(srcdir)/hid/ps/hid.conf \
252         gpcb-menu.res.in \
253         pcb-menu.res.in \
254         gpcb-menu.res.h \
255         pcb-menu.res.h \
256         pcbtest.sh.in \
257         dbus.xml
259 AM_YFLAGS=      -d
261 all-local: pcbtest.sh
263 pcb-menu.res : pcb-menu.res.in
264         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res.in DO NOT EDIT */' > $@
265         cat ${srcdir}/pcb-menu.res.in >> $@
267 pcb-menu.h : pcb-menu.res
268         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@
269         echo 'const char *pcb_menu_default[] = {' >> $@
270         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < pcb-menu.res >> $@
271         echo '0};' >> $@
273 gpcb-menu.res : gpcb-menu.res.in
274         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res.in DO NOT EDIT */' > $@
275         cat ${srcdir}/gpcb-menu.res.in >> $@
277 gpcb-menu.h : gpcb-menu.res
278         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@
279         echo 'const char *gpcb_menu_default[] = {' >> $@
280         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < gpcb-menu.res >> $@
281         echo '0};' >> $@
283 # Menus i18n
284 %.res.h : %.res
285         $(INTLTOOL_EXTRACT) --type=gettext/quoted $^
286         mv -f $@ ${srcdir}/$@ || true
288 check-local: gpcb-menu.res.h pcb-menu.res.h
290 hid/common/hidlist.h : Makefile
291         $(MKDIR_P) hid/common
292         true > $@
293         for e in ${HIDLIST}; do \
294           echo "HID_DEF($${e})" >> $@; \
295         done
297 libgtk_a_CPPFLAGS = -I$(top_srcdir) -I./hid/gtk
298 LIBGTK_SRCS = \
299         dolists.h \
300         hid/hidint.h \
301         hid/gtk/ghid-cell-renderer-visibility.c \
302         hid/gtk/ghid-cell-renderer-visibility.h \
303         hid/gtk/ghid-coord-entry.c \
304         hid/gtk/ghid-coord-entry.h \
305         hid/gtk/ghid-layer-selector.c \
306         hid/gtk/ghid-layer-selector.h \
307         hid/gtk/ghid-main-menu.c \
308         hid/gtk/ghid-main-menu.h \
309         hid/gtk/ghid-route-style-selector.c \
310         hid/gtk/ghid-route-style-selector.h \
311         hid/gtk/gtkhid-main.c \
312         hid/gtk/gtkhid.h \
313         hid/gtk/gui.h \
314         hid/gtk/gui-command-window.c \
315         hid/gtk/gui-config.c \
316         hid/gtk/gui-dialog-print.c \
317         hid/gtk/gui-dialog.c \
318         hid/gtk/gui-drc-window.c \
319         hid/gtk/gui-drc-window.h \
320         hid/gtk/gui-keyref-window.c \
321         hid/gtk/gui-library-window.c \
322         hid/gtk/gui-library-window.h \
323         hid/gtk/gui-log-window.c \
324         hid/gtk/gui-misc.c \
325         hid/gtk/gui-netlist-window.c \
326         hid/gtk/gui-output-events.c \
327         hid/gtk/gui-pinout-preview.c \
328         hid/gtk/gui-pinout-preview.h \
329         hid/gtk/gui-pinout-window.c \
330         hid/gtk/gui-top-window.c \
331         hid/gtk/gui-utils.c
332 libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h
334 hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile
335         $(MKDIR_P) hid/gtk
336         true > $@
337         (for f in ${LIBGTK_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
338         mv $@.tmp $@
340 # If we are building with dbus support, we need some extra files
341 if WITH_DBUS
342 dbus-introspect.h : dbus.xml Makefile
343         echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp
344         echo "static char *pcb_dbus_introspect_xml ="  > $@.tmp
345         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp
346         echo ";" >> $@.tmp
347         mv $@.tmp $@
349 PCB_SRCS+=      ${DBUS_SRCS}
350 BUILT_SOURCES+= dbus-introspect.h
351 endif
353 # If we are building with GL support, we need some extra files
354 if USE_GL
355 PCB_SRCS+=      ${GL_SRCS}
356 LIBGTK_SRCS+=   ${LIBGTK_GL_SRCS}
357 else
358 LIBGTK_SRCS+=   ${LIBGTK_GDK_SRCS}
359 endif
361 # If we are building on win32, then compile in some icons for the
362 # desktop and application toolbar
363 if WIN32
364 pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc
365         $(WINDRES) $(srcdir)/hid/gtk/pcb.rc $@
367 pcb_icon.ico: $(top_srcdir)/data/pcb_icon.ico
368         cp $(top_srcdir)/data/pcb_icon.ico $@
370 pcb_LDADD+=                     pcb_icon.o
371 pcb_DEPENDENCIES+=      pcb_icon.o
372 endif
374 liblesstif_a_CPPFLAGS = -I$(top_srcdir) -I./hid/lesstif
375 LIBLESSTIF_SRCS = \
376         dolists.h \
377         hid/hidint.h \
378         hid/lesstif/dialogs.c \
379         hid/lesstif/lesstif.h \
380         hid/lesstif/library.c \
381         hid/lesstif/main.c \
382         hid/lesstif/menu.c \
383         hid/lesstif/netlist.c \
384         hid/lesstif/styles.c \
385         hid/lesstif/xincludes.h 
386 liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h
388 hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile
389         $(MKDIR_P) hid/lesstif
390         true > $@
391         (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
392         mv $@.tmp $@
394 libbatch_a_CPPFLAGS = -I$(top_srcdir) -I./hid/batch
395 LIBBATCH_SRCS = \
396         hid/hidint.h \
397         hid/batch/batch.c 
398 libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h
400 hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile
401         $(MKDIR_P) hid/batch
402         true > $@
403         (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
404         mv $@.tmp $@
406 libgerber_a_CPPFLAGS = -I$(top_srcdir)
407 libgerber_a_SOURCES = \
408         hid/hidint.h \
409         hid/gerber/gerber.c
411 libbom_a_CPPFLAGS = -I$(top_srcdir)
412 libbom_a_SOURCES = \
413         hid/hidint.h \
414         hid/bom/bom.c
416 libipcd356_a_CPPFLAGS = -I$(top_srcdir)
417 libipcd356_a_SOURCES = \
418         hid/hidint.h \
419         hid/ipcd356/ipcd356.c
421 libps_a_CPPFLAGS = -I$(top_srcdir) -I./hid/ps
422 LIBPS_SRCS = \
423         dolists.h \
424         hid/hidint.h \
425         hid/ps/ps.c \
426         hid/ps/ps.h \
427         hid/ps/eps.c 
428 libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h
430 hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile
431         $(MKDIR_P) hid/ps
432         true > $@
433         (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
434         mv $@.tmp $@
436 libpng_a_CPPFLAGS = -I$(top_srcdir) -I./hid/png
437 LIBPNG_SRCS = \
438         dolists.h \
439         hid/hidint.h \
440         hid/png/png.c \
441         hid/png/png.h 
442 libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h
444 hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile
445         $(MKDIR_P) hid/png
446         true > $@
447         (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
448         mv $@.tmp $@
450 libgcode_a_CPPFLAGS = -I$(top_srcdir) -I./hid/gcode
451 LIBGCODE_SRCS = \
452         dolists.h \
453         hid/hidint.h \
454         hid/gcode/gcode.c \
455         hid/gcode/decompose.c \
456         hid/gcode/decompose.h \
457         hid/gcode/trace.c \
458         hid/gcode/trace.h \
459         hid/gcode/curve.c \
460         hid/gcode/curve.h \
461         hid/gcode/auxiliary.h \
462         hid/gcode/bitmap.h \
463         hid/gcode/lists.h \
464         hid/gcode/potracelib.h 
465 libgcode_a_SOURCES = ${LIBGCODE_SRCS} hid/gcode/gcode_lists.h
467 hid/gcode/gcode_lists.h : ${LIBGCODE_SRCS} Makefile
468         $(MKDIR_P) hid/gcode
469         true > $@
470         (for f in ${LIBGCODE_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
471         mv $@.tmp $@
473 libnelma_a_CPPFLAGS = -I$(top_srcdir) -I./hid/nelma
474 LIBNELMA_SRCS = \
475         dolists.h \
476         hid/hidint.h \
477         hid/nelma/nelma.c
478 libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h
480 hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile
481         $(MKDIR_P) hid/nelma
482         true > $@
483         (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
484         mv $@.tmp $@
486 liblpr_a_CPPFLAGS = -I$(top_srcdir)
487 liblpr_a_SOURCES = \
488         hid/hidint.h \
489         hid/lpr/lpr.c
491 DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \
492         hid/batch/batch_lists.h \
493         hid/common/hidlist.h \
494         hid/gtk/gtk_lists.h \
495         hid/lesstif/lesstif_lists.h \
496         hid/png/png_lists.h \
497         hid/gcode/gcode_lists.h \
498         hid/nelma/nelma_lists.h \
499         hid/ps/ps_lists.h \
500         core_lists.h \
501         dbus-introspect.h \
502         gpcb-menu.res \
503         pcb-menu.res \
504         gpcb-menu.res.h \
505         pcb-menu.res.h
507 # create wrapper script that lets you test pcb prior to installation
508 pcbtest.sh:     $(srcdir)/pcbtest.sh.in Makefile
509         sed -e 's;@BUILDDIR@;${abs_builddir};g' -e 's;@TOP_BUILDDIR@;${abs_top_builddir};g' \
510                 -e 's;@TOPSRCDIR@;${abs_top_srcdir};g' \
511                 $(srcdir)/pcbtest.sh.in > $@
512         chmod 755 $@