Fix bug with expanding text.
[geda-pcb/pcjc2.git] / src / Makefile.am
blob3fec01f8c7c9632ea5eebfd09ef062af21cf4b31
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
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 endif
208 # All these -I$(top_srcdir) in this file are for globalconst.h.
209 pcb_CPPFLAGS = -I$(top_srcdir)
210 pcb_SOURCES = ${PCB_SRCS} core_lists.h
212 TEST_SRCS = \
213         pcb-printf.c    \
214         main-test.c
216 unittest_CPPFLAGS = -I$(top_srcdir) -DPCB_UNIT_TEST
217 unittest_SOURCES = ${TEST_SRCS}
218 check_PROGRAMS = unittest
219 check_SCRIPTS = unittest
220 TESTS = unittest
222 # Action, Attribute, and Flag lists.
223 core_lists.h : ${PCB_SRCS} Makefile
224         true > $@
225         (for f in ${PCB_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
226         mv $@.tmp $@
228 DEFS=   -DLOCALEDIR=\"$(localedir)\" @DEFS@
230 EXTRA_DIST= \
231         check_icon.data \
232         default_font \
233         $(srcdir)/hid/batch/hid.conf \
234         $(srcdir)/hid/bom/hid.conf \
235         $(srcdir)/hid/gcode/hid.conf \
236         $(srcdir)/hid/gerber/hid.conf \
237         $(srcdir)/hid/gtk/gui-icons-misc.data \
238         $(srcdir)/hid/gtk/gui-icons-mode-buttons.data \
239         $(srcdir)/hid/gtk/hid.conf \
240         $(srcdir)/hid/gtk/pcb.rc \
241         $(srcdir)/hid/lesstif/hid.conf \
242         $(srcdir)/hid/lpr/hid.conf \
243         $(srcdir)/hid/png/hid.conf \
244         $(srcdir)/hid/nelma/hid.conf \
245         $(srcdir)/hid/ps/hid.conf \
246         gpcb-menu.res.in \
247         pcb-menu.res.in \
248         gpcb-menu.res.h \
249         pcb-menu.res.h \
250         pcbtest.sh.in \
251         dbus.xml
253 AM_YFLAGS=      -d
255 all-local: pcbtest.sh
257 pcb-menu.res : pcb-menu.res.in
258         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res.in DO NOT EDIT */' > $@
259         cat ${srcdir}/pcb-menu.res.in >> $@
261 pcb-menu.h : pcb-menu.res
262         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@
263         echo 'const char *pcb_menu_default[] = {' >> $@
264         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < pcb-menu.res >> $@
265         echo '0};' >> $@
267 gpcb-menu.res : gpcb-menu.res.in
268         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res.in DO NOT EDIT */' > $@
269         cat ${srcdir}/gpcb-menu.res.in >> $@
271 gpcb-menu.h : gpcb-menu.res
272         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@
273         echo 'const char *gpcb_menu_default[] = {' >> $@
274         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < gpcb-menu.res >> $@
275         echo '0};' >> $@
277 # Menus i18n
278 %.res.h : %.res
279         $(INTLTOOL_EXTRACT) --type=gettext/quoted $^
280         mv -f $@ ${srcdir}/$@ || true
282 check-local: gpcb-menu.res.h pcb-menu.res.h
284 hid/common/hidlist.h : Makefile
285         $(MKDIR_P) hid/common
286         true > $@
287         for e in ${HIDLIST}; do \
288           echo "HID_DEF($${e})" >> $@; \
289         done
291 libgtk_a_CPPFLAGS = -I$(top_srcdir) -I./hid/gtk
292 LIBGTK_SRCS = \
293         dolists.h \
294         hid/hidint.h \
295         hid/gtk/ghid-cell-renderer-visibility.c \
296         hid/gtk/ghid-cell-renderer-visibility.h \
297         hid/gtk/ghid-coord-entry.c \
298         hid/gtk/ghid-coord-entry.h \
299         hid/gtk/ghid-layer-selector.c \
300         hid/gtk/ghid-layer-selector.h \
301         hid/gtk/ghid-main-menu.c \
302         hid/gtk/ghid-main-menu.h \
303         hid/gtk/ghid-route-style-selector.c \
304         hid/gtk/ghid-route-style-selector.h \
305         hid/gtk/gtkhid-main.c \
306         hid/gtk/gtkhid.h \
307         hid/gtk/gui.h \
308         hid/gtk/gui-command-window.c \
309         hid/gtk/gui-config.c \
310         hid/gtk/gui-dialog-print.c \
311         hid/gtk/gui-dialog.c \
312         hid/gtk/gui-drc-window.c \
313         hid/gtk/gui-drc-window.h \
314         hid/gtk/gui-keyref-window.c \
315         hid/gtk/gui-library-window.c \
316         hid/gtk/gui-library-window.h \
317         hid/gtk/gui-log-window.c \
318         hid/gtk/gui-misc.c \
319         hid/gtk/gui-netlist-window.c \
320         hid/gtk/gui-output-events.c \
321         hid/gtk/gui-pinout-preview.c \
322         hid/gtk/gui-pinout-preview.h \
323         hid/gtk/gui-pinout-window.c \
324         hid/gtk/gui-top-window.c \
325         hid/gtk/gui-utils.c
326 libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h
328 hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile
329         $(MKDIR_P) hid/gtk
330         true > $@
331         (for f in ${LIBGTK_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
332         mv $@.tmp $@
334 # If we are building with dbus support, we need some extra files
335 if WITH_DBUS
336 dbus-introspect.h : dbus.xml Makefile
337         echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp
338         echo "static char *pcb_dbus_introspect_xml ="  > $@.tmp
339         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp
340         echo ";" >> $@.tmp
341         mv $@.tmp $@
343 PCB_SRCS+=      ${DBUS_SRCS}
344 BUILT_SOURCES+= dbus-introspect.h
345 endif
347 # If we are building with GL support, we need some extra files
348 if USE_GL
349 PCB_SRCS+=      ${GL_SRCS}
350 LIBGTK_SRCS+=   ${LIBGTK_GL_SRCS}
351 else
352 LIBGTK_SRCS+=   ${LIBGTK_GDK_SRCS}
353 endif
355 # If we are building on win32, then compile in some icons for the
356 # desktop and application toolbar
357 if WIN32
358 pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc
359         $(WINDRES) $(srcdir)/hid/gtk/pcb.rc $@
361 pcb_icon.ico: $(top_srcdir)/data/pcb_icon.ico
362         cp $(top_srcdir)/data/pcb_icon.ico $@
364 pcb_LDADD+=                     pcb_icon.o
365 pcb_DEPENDENCIES+=      pcb_icon.o
366 endif
368 liblesstif_a_CPPFLAGS = -I$(top_srcdir) -I./hid/lesstif
369 LIBLESSTIF_SRCS = \
370         dolists.h \
371         hid/hidint.h \
372         hid/lesstif/dialogs.c \
373         hid/lesstif/lesstif.h \
374         hid/lesstif/library.c \
375         hid/lesstif/main.c \
376         hid/lesstif/menu.c \
377         hid/lesstif/netlist.c \
378         hid/lesstif/styles.c \
379         hid/lesstif/xincludes.h 
380 liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h
382 hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile
383         $(MKDIR_P) hid/lesstif
384         true > $@
385         (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
386         mv $@.tmp $@
388 libbatch_a_CPPFLAGS = -I$(top_srcdir) -I./hid/batch
389 LIBBATCH_SRCS = \
390         hid/hidint.h \
391         hid/batch/batch.c 
392 libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h
394 hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile
395         $(MKDIR_P) hid/batch
396         true > $@
397         (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
398         mv $@.tmp $@
400 libgerber_a_CPPFLAGS = -I$(top_srcdir)
401 libgerber_a_SOURCES = \
402         hid/hidint.h \
403         hid/gerber/gerber.c
405 libbom_a_CPPFLAGS = -I$(top_srcdir)
406 libbom_a_SOURCES = \
407         hid/hidint.h \
408         hid/bom/bom.c
410 libps_a_CPPFLAGS = -I$(top_srcdir) -I./hid/ps
411 LIBPS_SRCS = \
412         dolists.h \
413         hid/hidint.h \
414         hid/ps/ps.c \
415         hid/ps/ps.h \
416         hid/ps/eps.c 
417 libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h
419 hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile
420         $(MKDIR_P) hid/ps
421         true > $@
422         (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
423         mv $@.tmp $@
425 libpng_a_CPPFLAGS = -I$(top_srcdir) -I./hid/png
426 LIBPNG_SRCS = \
427         dolists.h \
428         hid/hidint.h \
429         hid/png/png.c \
430         hid/png/png.h 
431 libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h
433 hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile
434         $(MKDIR_P) hid/png
435         true > $@
436         (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
437         mv $@.tmp $@
439 libgcode_a_CPPFLAGS = -I$(top_srcdir) -I./hid/gcode
440 LIBGCODE_SRCS = \
441         dolists.h \
442         hid/hidint.h \
443         hid/gcode/gcode.c \
444         hid/gcode/decompose.c \
445         hid/gcode/decompose.h \
446         hid/gcode/trace.c \
447         hid/gcode/trace.h \
448         hid/gcode/curve.c \
449         hid/gcode/curve.h \
450         hid/gcode/auxiliary.h \
451         hid/gcode/bitmap.h \
452         hid/gcode/lists.h \
453         hid/gcode/potracelib.h 
454 libgcode_a_SOURCES = ${LIBGCODE_SRCS} hid/gcode/gcode_lists.h
456 hid/gcode/gcode_lists.h : ${LIBGCODE_SRCS} Makefile
457         $(MKDIR_P) hid/gcode
458         true > $@
459         (for f in ${LIBGCODE_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
460         mv $@.tmp $@
462 libnelma_a_CPPFLAGS = -I$(top_srcdir) -I./hid/nelma
463 LIBNELMA_SRCS = \
464         dolists.h \
465         hid/hidint.h \
466         hid/nelma/nelma.c
467 libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h
469 hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile
470         $(MKDIR_P) hid/nelma
471         true > $@
472         (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
473         mv $@.tmp $@
475 liblpr_a_CPPFLAGS = -I$(top_srcdir)
476 liblpr_a_SOURCES = \
477         hid/hidint.h \
478         hid/lpr/lpr.c
480 DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \
481         hid/batch/batch_lists.h \
482         hid/common/hidlist.h \
483         hid/gtk/gtk_lists.h \
484         hid/lesstif/lesstif_lists.h \
485         hid/png/png_lists.h \
486         hid/gcode/gcode_lists.h \
487         hid/nelma/nelma_lists.h \
488         hid/ps/ps_lists.h \
489         core_lists.h \
490         dbus-introspect.h \
491         gpcb-menu.res \
492         pcb-menu.res \
493         gpcb-menu.res.h \
494         pcb-menu.res.h
496 # create wrapper script that lets you test pcb prior to installation
497 pcbtest.sh:     $(srcdir)/pcbtest.sh.in Makefile
498         sed -e 's;@BUILDDIR@;${abs_builddir};g' -e 's;@TOP_BUILDDIR@;${abs_top_builddir};g' \
499                 -e 's;@TOPSRCDIR@;${abs_top_srcdir};g' \
500                 $(srcdir)/pcbtest.sh.in > $@
501         chmod 755 $@