Merge the usermenu branch. This reworks how the menus and hotkeys
[geda-pcb/pcjc2.git] / src / Makefile.am
blobc6cb21c9b93e4f4537aefb2c18a18c00c89818b4
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
17 pcblib_DATA=    \
18         default_font \
19         gpcb-menu.res \
20         pcb-menu.res
22 bin_PROGRAMS=   pcb
24 AM_CFLAGS = -DNDEBUG
26 PCB_SRCS = \
27         action.c \
28         action.h \
29         autoplace.c \
30         autoplace.h \
31         autoroute.c \
32         autoroute.h \
33         box.h \
34         buffer.c \
35         buffer.h \
36         change.c \
37         change.h \
38         clip.c \
39         clip.h \
40         command.c \
41         command.h \
42         compat.c \
43         compat.h \
44         const.h \
45         copy.c \
46         copy.h \
47         create.c \
48         create.h \
49         crosshair.c \
50         crosshair.h \
51         data.c \
52         data.h \
53         djopt.c \
54         djopt.h \
55         dolists.h \
56         draw.c \
57         draw.h \
58         drill.c \
59         drill.h \
60         error.c \
61         error.h \
62         file.c \
63         file.h \
64         find.c \
65         find.h \
66         flags.c \
67         fontmode.c \
68         global.h \
69         heap.c \
70         heap.h \
71         hid.h \
72         insert.c \
73         insert.h \
74         intersect.c \
75         intersect.h \
76         line.c \
77         line.h \
78         lrealpath.c \
79         lrealpath.h \
80         macro.h \
81         main.c \
82         mirror.c \
83         mirror.h \
84         misc.c \
85         misc.h \
86         move.c \
87         move.h \
88         mtspace.c \
89         mtspace.h \
90         mymem.c \
91         mymem.h \
92         netlist.c \
93         parse_l.h \
94         parse_l.l \
95         parse_y.h \
96         parse_y.y \
97         polygon.c \
98         polygon.h \
99         polygon1.c \
100         polyarea.h \
101         puller.c \
102         print.c \
103         print.h \
104         rats.c \
105         rats.h \
106         remove.c \
107         remove.h \
108         report.c \
109         report.h \
110         res_parse.y \
111         res_lex.l \
112         resource.h \
113         rotate.c \
114         rotate.h \
115         rtree.c \
116         rtree.h \
117         rubberband.c \
118         rubberband.h \
119         search.c \
120         search.h \
121         select.c \
122         select.h \
123         set.c \
124         set.h \
125         strflags.c \
126         strflags.h \
127         thermal.c \
128         thermal.h \
129         undo.c \
130         undo.h \
131         vector.c \
132         vector.h \
133         vendor.c \
134         vendor.h \
135         hid/common/actions.c \
136         hid/common/flags.c \
137         hid/common/hidinit.c \
138         hid/common/hidnogui.c \
139         hid/common/extents.c \
140         hid/hidint.h 
141 pcb_SOURCES = ${PCB_SRCS} core_lists.h
143 EXTRA_pcb_SOURCES = ${DBUS_SRCS}
144 DBUS_SRCS= \
145         dbus-pcbmain.c \
146         dbus-pcbmain.h \
147         dbus.h \
148         dbus.c
150 BUILT_SOURCES = \
151         core_lists.h \
152         gpcb-menu.h \
153         hid/gtk/gtk_lists.h \
154         hid/lesstif/lesstif_lists.h \
155         hid/batch/batch_lists.h \
156         hid/png/png_lists.h \
157         hid/nelma/nelma_lists.h \
158         hid/ps/ps_lists.h \
159         parse_y.h \
160         pcb-menu.h \
161         res_parse.h \
162         hid/common/hidlist.h
164 pcb_LDADD = @HIDLIBS@
165 pcb_DEPENDENCIES = @HIDLIBS@
167 # Action, Attribute, and Flag lists.
168 core_lists.h : ${PCB_SRCS} Makefile
169         true > $@
170         (for f in ${PCB_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
171         mv $@.tmp $@
173 # for globalconst.h
174 INCLUDES=       -I$(top_srcdir) -I$(srcdir)/icons
176 EXTRA_DIST= \
177         check_icon.data \
178         default_font \
179         $(srcdir)/hid/bom/hid.conf \
180         $(srcdir)/hid/gerber/hid.conf \
181         $(srcdir)/hid/gtk/gui-icons-misc.data \
182         $(srcdir)/hid/gtk/gui-icons-mode-buttons.data \
183         $(srcdir)/hid/gtk/hid.conf \
184         $(srcdir)/hid/gtk/pcb.rc \
185         $(srcdir)/hid/lesstif/hid.conf \
186         $(srcdir)/hid/lpr/hid.conf \
187         $(srcdir)/hid/png/hid.conf \
188         $(srcdir)/hid/nelma/hid.conf \
189         $(srcdir)/hid/ps/hid.conf \
190         gpcb-menu.res \
191         pcb-menu.res \
192         pcbtest.sh.in \
193         dbus.xml
195 AM_YFLAGS=      -d
197 all-local: pcbtest.sh
199 pcb-menu.h : pcb-menu.res
200         echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@
201         echo 'const char *pcb_menu_default[] = {' >> $@
202         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < ${srcdir}/pcb-menu.res >> $@
203         echo '0};' >> $@
205 gpcb-menu.h : gpcb-menu.res
206         echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@
207         echo 'const char *gpcb_menu_default[] = {' >> $@
208         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < ${srcdir}/gpcb-menu.res >> $@
209         echo '0};' >> $@
211 hid/common/hidlist.h : Makefile
212         true > $@
213         for e in ${HIDLIST}; do \
214           echo "HID_DEF($${e})" >> $@; \
215         done
217 libgtk_a_CPPFLAGS = -I./hid/gtk
218 LIBGTK_SRCS = \
219         dolists.h \
220         hid/hidint.h \
221         hid/gtk/gtkhid-main.c \
222         hid/gtk/gtkhid.h \
223         hid/gtk/gui.h \
224         hid/gtk/gui-command-window.c \
225         hid/gtk/gui-config.c \
226         hid/gtk/gui-dialog-print.c \
227         hid/gtk/gui-dialog-size.c \
228         hid/gtk/gui-dialog.c \
229         hid/gtk/gui-keyref-window.c \
230         hid/gtk/gui-library-window.c \
231         hid/gtk/gui-log-window.c \
232         hid/gtk/gui-misc.c \
233         hid/gtk/gui-netlist-window.c \
234         hid/gtk/gui-output-events.c \
235         hid/gtk/gui-pinout-window.c \
236         hid/gtk/gui-top-window.c \
237         hid/gtk/gui-utils.c
238 libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h
240 hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile
241         true > $@
242         (for f in ${LIBGTK_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
243         mv $@.tmp $@
245 # If we are building with dbus support, we need some extra files
246 if WITH_DBUS
247 dbus-introspect.h : dbus.xml Makefile
248         echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp
249         echo "static char *pcb_dbus_introspect_xml ="  > $@.tmp
250         sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp
251         echo ";" >> $@.tmp
252         mv $@.tmp $@
254 PCB_SRCS+=      ${DBUS_SRCS}
255 BUILT_SOURCES+= dbus-introspect.h
257 endif
259 # If we are building on win32, then compile in some icons for the
260 # desktop and application toolbar
261 if WIN32
262 pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc
263         windres $(srcdir)/hid/gtk/pcb.rc $@
265 pcb_icon.ico: $(top_srcdir)/win32/pcb_icon.ico
266         cp $(top_srcdir)/win32/pcb_icon.ico $@
268 pcb_LDADD+=                     pcb_icon.o
269 pcb_DEPENDENCIES+=      pcb_icon.o
271 endif
274 liblesstif_a_CPPFLAGS = -I./hid/lesstif
275 LIBLESSTIF_SRCS = \
276         dolists.h \
277         hid/hidint.h \
278         hid/lesstif/dialogs.c \
279         hid/lesstif/lesstif.h \
280         hid/lesstif/library.c \
281         hid/lesstif/main.c \
282         hid/lesstif/menu.c \
283         hid/lesstif/netlist.c \
284         hid/lesstif/styles.c \
285         hid/lesstif/xincludes.h 
286 liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h
288 hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile
289         true > $@
290         (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
291         mv $@.tmp $@
293 libbatch_a_CPPFLAGS = -I./hid/batch
294 LIBBATCH_SRCS = \
295         hid/hidint.h \
296         hid/batch/batch.c 
297 libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h
299 hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile
300         true > $@
301         (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
302         mv $@.tmp $@
304 libgerber_a_SOURCES = \
305         hid/hidint.h \
306         hid/gerber/gerber.c
308 libbom_a_SOURCES = \
309         hid/hidint.h \
310         hid/bom/bom.c
312 libps_a_CPPFLAGS = -I./hid/ps
313 LIBPS_SRCS = \
314         dolists.h \
315         hid/hidint.h \
316         hid/ps/ps.c \
317         hid/ps/ps.h \
318         hid/ps/eps.c 
319 libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h
321 hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile
322         true > $@
323         (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
324         mv $@.tmp $@
326 libpng_a_CPPFLAGS = -I./hid/png
327 LIBPNG_SRCS = \
328         dolists.h \
329         hid/hidint.h \
330         hid/png/png.c \
331         hid/png/png.h 
332 libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h
334 hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile
335         true > $@
336         (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
337         mv $@.tmp $@
339 libnelma_a_CPPFLAGS = -I./hid/nelma
340 LIBNELMA_SRCS = \
341         dolists.h \
342         hid/hidint.h \
343         hid/nelma/nelma.c \
344         hid/nelma/nelma.h 
345 libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h
347 hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile
348         true > $@
349         (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp
350         mv $@.tmp $@
352 liblpr_a_SOURCES = \
353         hid/hidint.h \
354         hid/lpr/lpr.c
356 DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \
357         hid/batch/batch_lists.h \
358         hid/common/hidlist.h \
359         hid/gtk/gtk_lists.h \
360         hid/lesstif/lesstif_lists.h \
361         hid/png/png_lists.h \
362         hid/nelma/nelma_lists.h \
363         hid/ps/ps_lists.h \
364         core_lists.h \
365         dbus-introspect.h
368 # create wrapper script that lets you test pcb prior to installation
369 pcbtest.sh:     $(srcdir)/pcbtest.sh.in Makefile
370         sed -e "s;@BUILDDIR@;`pwd`;g" -e "s;@TOPSRCDIR@;${top_srcdir};g" \
371                 $(srcdir)/pcbtest.sh.in > $@
372         chmod 755 $@