chiark / gitweb /
3ab9201ceea2313fcff07897eb2ed7f4fef42b9d
[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 /*
60  * If EtcX11Directory is defined, we're using a relatively modern X.Org or
61  * XFree86 release.
62  */
63 #ifdef EtcX11Directory
64           CONFDIR = $(ETCX11DIR)
65 #else
66           CONFDIR = $(LIBDIR)
67 #endif
68
69 XCOMM Installation path for VTWM's system resource file
70        VTWMCONFDIR = $(CONFDIR)/vtwm
71
72 XCOMM Location where we search for TWM's system resource file
73        TWMCONFDIR = $(CONFDIR)/twm
74
75 XCOMM Installation path for the man page
76        VTWMMANDIR = $(MANDIR)
77
78 XCOMM For the traditional look of TWM as the system fallback,
79 XCOMM change this to "2D"
80   SYS_VTWMRC_LOOK = 3D
81
82 XCOMM ================ End of common editables ======================
83
84 XCOMM ============= Start of less common editables ==================
85
86 XCOMM Handy for developers to check man page editions
87 XCOMM (see the end of this file)
88            DEROFF = deroff
89                DW = dw
90             SPELL = spell
91
92 XCOMM Required to generate HTML or Postscript versions of the man page
93 XCOMM (see the end of this file)
94          MAN2HTML = man2html
95            MAN2PS = man2ps
96
97 XCOMM ============== End of less common editables ===================
98
99 XCOMM ========= Editing below here should not be necessary ==========
100
101            YFLAGS = -d
102           DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
103   LOCAL_LIBRARIES = $(LEXLIB) $(XPMLIB) $(REGEXLIB) $(SOUNDLIB) \
104                     $(XMULIB) $(EXTENSIONLIB) $(XLIB)
105          LINTLIBS = $(LINTXMU) $(LINTEXTENSIONLIB) $(LINTXLIB)
106    EXTRA_INCLUDES = $(XPMINC) $(REGEXINC) $(SOUNDINC)
107           DEFINES = $(SIGNAL_DEFINES) $(NO_XPM_SUPPORT) $(NO_REGEX_SUPPORT) \
108                     $(NO_SOUND_SUPPORT) $(NO_I18N_SUPPORT) $(NO_M4_SUPPORT)
109
110              SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c \
111                     twm.c sound.c parse.c menus.c events.c resize.c util.c \
112                     version.c iconmgr.c cursor.c regions.c applets.c \
113                     icons.c desktop.c doors.c lastmake.c
114
115              OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o \
116                     twm.o sound.o parse.o menus.o events.o resize.o util.o \
117                     version.o iconmgr.o cursor.o regions.o applets.o \
118                     icons.o desktop.o doors.o lastmake.o
119
120 AllTarget(vtwm)
121
122 SpecialObjectRule(menus.o,gram.h,$(NO_BUILD_INFO) $(NEED_PROCESS_H))
123
124 SpecialObjectRule(util.o,gram.h,$(NEED_PUTENV_F))
125
126 SpecialObjectRule(events.o,gram.h,$(NEED_SELECT_H))
127
128 SpecialObjectRule(parse.o,gram.h,$(NEED_YYLINENO_V) \
129 '-DSYSTEM_VTWMRC="'$(VTWMCONFDIR)'/system.vtwmrc"' \
130 '-DSYSTEM_TWMRC="'$(VTWMCONFDIR)'/system.twmrc"')
131
132 SpecialObjectRule(add_window.o applets.o icons.o \
133 list.o regions.o sound.o twm.o,gram.h,NullParameter)
134
135 NormalProgramTarget(vtwm,$(OBJS),$(DEPLIBS),$(LOCAL_LIBRARIES),NullParameter)
136
137 InstallProgram(vtwm,$(VTWMBINDIR))
138 InstallManPage(vtwm,$(VTWMMANDIR))
139 InstallNonExecFile(system.vtwmrc,$(VTWMCONFDIR))
140
141 depend:: lex.c gram.c deftwmrc.c lastmake.c vtwm.man
142
143 all::
144         $(RM) deftwmrc.* lastmake.*
145
146 install::
147         $(RM) deftwmrc.* lastmake.*
148         $(MAKE) install.man
149
150 clean::
151         $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c \
152         lastmake.c system.vtwmrc vtwm.dw vtwm.ser vtwm.html vtwm.ps vtwm.man
153
154 gram.h gram.c: gram.y
155         $(YACC) $(YFLAGS) gram.y
156         $(MV) y.tab.c gram.c
157         $(MV) y.tab.h gram.h
158
159 deftwmrc.c: system.vtwmrc
160         $(RM) $@
161         echo '/* ' >>$@
162         echo ' * This file is generated automatically from the default' >>$@
163         echo ' * VTWM bindings file system.vtwmrc.'$(SYS_VTWMRC_LOOK)' by the VTWM Makefile.' >>$@
164         echo ' */' >>$@
165         echo '' >>$@
166         echo 'char *defTwmrc[] = {' >>deftwmrc.c
167         sed -e '/^$$/d' -e '/^#/d' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/",/' -e 's/[     ]\{1,\}/ /g' -e 's/^" /"/' system.vtwmrc >>$@
168         echo '(char *)0 };' >>$@
169
170 lastmake.c:
171         $(RM) $@
172         echo '/* ' >>$@
173         echo ' * This file is generated automatically by the VTWM Makefile.' >>$@
174         echo ' */' >>$@
175         echo '' >>$@
176         echo 'char *lastmake[] = {' >>lastmake.c
177 ifdef SOURCE_DATE_EPOCH
178         echo '    "Platform:  -",' >>$@
179         echo '    "Build:  '`LC_ALL=C date --utc --date=@$${SOURCE_DATE_EPOCH}`'",' >>$@
180 else
181         echo '    "Platform:  '`uname -r -s`'",' >>$@
182         echo '    "Build:  '`date`'",' >>$@
183 endif
184         echo '    "" };' >>$@
185
186 system.vtwmrc:
187         $(RM) $@
188         $(CP) $@.$(SYS_VTWMRC_LOOK) $@
189
190 vtwm.man:
191         $(RM) $@
192         $(LN) doc/$@ $@
193
194 XCOMM Handy for developers to check the man page
195 dw vtwm.dw: vtwm.man
196         $(DEROFF) vtwm.man | $(DW) >vtwm.dw
197         @if test -s vtwm.dw ; \
198         then \
199             echo Doubled words in vtwm.man ... ; \
200             cat vtwm.dw ; \
201         fi
202 spell vtwm.ser: vtwm.man vtwm.sok
203         $(DEROFF) vtwm.man | $(SPELL) +vtwm.sok >vtwm.ser
204         @if test -s vtwm.ser ; \
205         then \
206             echo Spelling exceptions in vtwm.man ... ; \
207             cat vtwm.ser ; \
208         fi
209
210 XCOMM If you wish to generate HTML or Postscript versions of the man page,
211 XCOMM enter 'make vtwm.html' or 'make vtwm.ps'
212 vtwm.html: vtwm.man
213         $(MAN2HTML) vtwm.man
214 vtwm.ps: vtwm.man
215         $(MAN2PS) < $< >$@