chiark / gitweb /
72db51e03e255d855aa819ffea9d8cbc61925853
[vtwm.git] / Imakefile
1 #ifndef XCOMM
2 #define XCOMM #
3 #endif
4
5 XCOMM $XConsortium: Imakefile,v 1.33 91/07/17 00:48:06 gildea Exp $
6 XCOMM
7 XCOMM Here is an Imakefile for VTWM.
8 XCOMM I like to use Imakefiles for everything, and I am sure other
9 XCOMM people do also, so perhaps you could do us all a favor and
10 XCOMM distribute this one.
11
12 XCOMM =============== Start of common editables =====================
13
14 XCOMM To omit XPM image support, uncomment this
15 XCOMM   NO_XPM_SUPPORT = -DNO_XPM_SUPPORT
16 XCOMM and comment these
17            XPMLIB = -lXpm
18            XPMINC =
19 XCOMM (version 3.4h of the XPM library is the earliest supported I know of)
20
21 XCOMM To omit regular expressions ("RE"s) support, uncomment this
22 XCOMM NO_REGEX_SUPPORT = -DNO_REGEX_SUPPORT
23 XCOMM and comment these
24          REGEXLIB =
25          REGEXINC =
26 XCOMM (the library must conform to the POSIX 1003.2 specification)
27
28 XCOMM To omit sound support, uncomment this
29 XCOMM NO_SOUND_SUPPORT = -DNO_SOUND_SUPPORT
30 XCOMM and comment these
31 SOUNDLIB = -L/usr/local/lib -lrplay
32 SOUNDINC = -I/usr/local/include
33 XCOMM (sound is supported only by way of the rplay library)
34
35 XCOMM To omit Internationalization support, uncomment this
36 XCOMM  NO_I18N_SUPPORT = -DNO_I18N_SUPPORT
37
38 XCOMM To omit m4 pre-processing of resource files, uncomment this
39 XCOMM    NO_M4_SUPPORT = -DNO_M4_SUPPORT
40
41 XCOMM To omit platform and build info in the version window, uncomment this
42 XCOMM    NO_BUILD_INFO = -DNO_BUILD_INFO
43
44 XCOMM For lexers that don't track line numbers, uncomment this
45 XCOMM  NEED_YYLINENO_V = -DNEED_YYLINENO_V
46
47 XCOMM For those systems that don't have putenv(), uncomment this
48 XCOMM    NEED_PUTENV_F = -DNEED_PUTENV_F
49
50 XCOMM For those systems that require sys/select.h, uncomment this
51 XCOMM    NEED_SELECT_H = -DNEED_SELECT_H
52
53 XCOMM For those systems that require process.h, uncomment this
54 XCOMM   NEED_PROCESS_H = -DNEED_PROCESS_H
55
56 XCOMM Installation path for the binary
57        VTWMBINDIR = $(BINDIR)
58
59 XCOMM Installation path for the system resource file
60        VTWMLIBDIR = $(LIBDIR)/twm
61
62 XCOMM Installation path for the man page
63        VTWMMANDIR = $(MANDIR)
64
65 XCOMM For the traditional look of TWM as the system fallback,
66 XCOMM change this to "2D"
67   SYS_VTWMRC_LOOK = 3D
68
69 XCOMM ================ End of common editables ======================
70
71 XCOMM ============= Start of less common editables ==================
72
73 XCOMM Handy for developers to check man page editions
74 XCOMM (see the end of this file)
75            DEROFF = deroff
76                DW = dw
77             SPELL = spell
78
79 XCOMM Required to generate HTML or Postscript versions of the man page
80 XCOMM (see the end of this file)
81          MAN2HTML = man2html
82            MAN2PS = man2ps
83
84 XCOMM ============== End of less common editables ===================
85
86 XCOMM ========= Editing below here should not be necessary ==========
87
88            YFLAGS = -d
89           DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
90   LOCAL_LIBRARIES = $(LEXLIB) $(XPMLIB) $(REGEXLIB) $(SOUNDLIB) \
91                     $(XMULIB) $(EXTENSIONLIB) $(XLIB)
92          LINTLIBS = $(LINTXMU) $(LINTEXTENSIONLIB) $(LINTXLIB)
93    EXTRA_INCLUDES = $(XPMINC) $(REGEXINC) $(SOUNDINC)
94           DEFINES = $(SIGNAL_DEFINES) $(NO_XPM_SUPPORT) $(NO_REGEX_SUPPORT) \
95                     $(NO_SOUND_SUPPORT) $(NO_I18N_SUPPORT) $(NO_M4_SUPPORT)
96
97              SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c \
98                     twm.c sound.c parse.c menus.c events.c resize.c util.c \
99                     version.c iconmgr.c cursor.c regions.c applets.c \
100                     icons.c desktop.c doors.c lastmake.c
101
102              OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o \
103                     twm.o sound.o parse.o menus.o events.o resize.o util.o \
104                     version.o iconmgr.o cursor.o regions.o applets.o \
105                     icons.o desktop.o doors.o lastmake.o
106
107 AllTarget(vtwm)
108
109 SpecialObjectRule(menus.o,gram.h,$(NO_BUILD_INFO) $(NEED_PROCESS_H))
110
111 SpecialObjectRule(util.o,gram.h,$(NEED_PUTENV_F))
112
113 SpecialObjectRule(events.o,gram.h,$(NEED_SELECT_H))
114
115 SpecialObjectRule(parse.o,gram.h,$(NEED_YYLINENO_V) \
116 '-DSYSTEM_VTWMRC="'$(VTWMLIBDIR)'/system.vtwmrc"' \
117 '-DSYSTEM_TWMRC="'$(VTWMLIBDIR)'/system.twmrc"')
118
119 SpecialObjectRule(add_window.o applets.o icons.o \
120 list.o regions.o sound.o twm.o,gram.h,NullParameter)
121
122 NormalProgramTarget(vtwm,$(OBJS),$(DEPLIBS),$(LOCAL_LIBRARIES),NullParameter)
123
124 InstallProgram(vtwm,$(VTWMBINDIR))
125 InstallManPage(vtwm,$(VTWMMANDIR))
126 InstallNonExecFile(system.vtwmrc,$(VTWMLIBDIR))
127
128 depend:: lex.c gram.c deftwmrc.c lastmake.c vtwm.man
129
130 all::
131         $(RM) deftwmrc.* lastmake.*
132
133 install::
134         $(RM) deftwmrc.* lastmake.*
135         $(MAKE) install.man
136
137 clean::
138         $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c \
139         lastmake.c system.vtwmrc vtwm.dw vtwm.ser vtwm.html vtwm.ps vtwm.man
140
141 gram.h gram.c: gram.y
142         $(YACC) $(YFLAGS) gram.y
143         $(MV) y.tab.c gram.c
144         $(MV) y.tab.h gram.h
145
146 deftwmrc.c: system.vtwmrc
147         $(RM) $@
148         echo '/* ' >>$@
149         echo ' * This file is generated automatically from the default' >>$@
150         echo ' * VTWM bindings file system.vtwmrc.'$(SYS_VTWMRC_LOOK)' by the VTWM Makefile.' >>$@
151         echo ' */' >>$@
152         echo '' >>$@
153         echo 'char *defTwmrc[] = {' >>deftwmrc.c
154         sed -e '/^$$/d' -e '/^#/d' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/",/' -e 's/[     ]\{1,\}/ /g' -e 's/^" /"/' system.vtwmrc >>$@
155         echo '(char *)0 };' >>$@
156
157 lastmake.c:
158         $(RM) $@
159         echo '/* ' >>$@
160         echo ' * This file is generated automatically by the VTWM Makefile.' >>$@
161         echo ' */' >>$@
162         echo '' >>$@
163         echo 'char *lastmake[] = {' >>lastmake.c
164         echo '    "Platform:  '`uname -r -s`'",' >>$@
165         echo '    "Build:  '`date`'",' >>$@
166         echo '    "" };' >>$@
167
168 system.vtwmrc:
169         $(RM) $@
170         $(CP) $@.$(SYS_VTWMRC_LOOK) $@
171
172 vtwm.man:
173         $(RM) $@
174         $(LN) doc/$@ $@
175
176 XCOMM Handy for developers to check the man page
177 dw vtwm.dw: vtwm.man
178         $(DEROFF) vtwm.man | $(DW) >vtwm.dw
179         @if test -s vtwm.dw ; \
180         then \
181             echo Doubled words in vtwm.man ... ; \
182             cat vtwm.dw ; \
183         fi
184 spell vtwm.ser: vtwm.man vtwm.sok
185         $(DEROFF) vtwm.man | $(SPELL) +vtwm.sok >vtwm.ser
186         @if test -s vtwm.ser ; \
187         then \
188             echo Spelling exceptions in vtwm.man ... ; \
189             cat vtwm.ser ; \
190         fi
191
192 XCOMM If you wish to generate HTML or Postscript versions of the man page,
193 XCOMM enter 'make vtwm.html' or 'make vtwm.ps'
194 vtwm.html: vtwm.man
195         $(MAN2HTML) vtwm.man
196 vtwm.ps: vtwm.man
197         $(MAN2PS) < $< >$@