1 | XCOMM Imakefile: How to build x11-ssh-askpass, using xmkmf and then make |
---|
2 | XCOMM |
---|
3 | XCOMM by Jim Knoble <jmknoble@pobox.com> |
---|
4 | XCOMM Copyright (C) 1999,2000,2001 Jim Knoble |
---|
5 | XCOMM |
---|
6 | XCOMM Disclaimer: |
---|
7 | XCOMM |
---|
8 | XCOMM This software is provided "as is", without warranty of any kind, |
---|
9 | XCOMM express or implied, including but not limited to the warranties of |
---|
10 | XCOMM merchantability, fitness for a particular purpose and |
---|
11 | XCOMM noninfringement. In no event shall the author(s) be liable for any |
---|
12 | XCOMM claim, damages or other liability, whether in an action of |
---|
13 | XCOMM contract, tort or otherwise, arising from, out of or in connection |
---|
14 | XCOMM with the software or the use or other dealings in the software. |
---|
15 | XCOMM |
---|
16 | XCOMM Permission to use, copy, modify, distribute, and sell this software |
---|
17 | XCOMM and its documentation for any purpose is hereby granted without |
---|
18 | XCOMM fee, provided that the above copyright notice appear in all copies |
---|
19 | XCOMM and that both that copyright notice and this permission notice |
---|
20 | XCOMM appear in supporting documentation. |
---|
21 | |
---|
22 | NAME = x11-ssh-askpass |
---|
23 | CLASS = SshAskpass |
---|
24 | |
---|
25 | XCOMM -------- configurable settings -------- |
---|
26 | BINDIR = /usr/local/libexec |
---|
27 | MANPATH = /usr/local/man |
---|
28 | MANDIR = $(MANPATH)/man1 |
---|
29 | APPDEFDIR = $(XAPPLOADDIR) |
---|
30 | APP_DEFAULTS = $(CLASS)-default.ad |
---|
31 | |
---|
32 | XCOMM CC = |
---|
33 | XCOMM CDEBUGFLAGS = |
---|
34 | XCOMM LOCAL_LDFLAGS = |
---|
35 | XCOMM -------- end configurable settings -------- |
---|
36 | |
---|
37 | #ifndef CpCmd |
---|
38 | # define CpCmd cp |
---|
39 | #endif |
---|
40 | |
---|
41 | #ifndef GzipCmd |
---|
42 | # define GzipCmd gzip |
---|
43 | #endif |
---|
44 | |
---|
45 | #ifndef LnCmd |
---|
46 | # if HasSymLinks |
---|
47 | # define LnCmd ln -s |
---|
48 | # else |
---|
49 | # define LnCmd ln |
---|
50 | # endif |
---|
51 | #endif |
---|
52 | |
---|
53 | #ifndef MvCmd |
---|
54 | # define MvCmd mv -f |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifndef RmCmd |
---|
58 | # define RmCmd rm -f |
---|
59 | #endif |
---|
60 | |
---|
61 | CAT = cat |
---|
62 | CHMOD = chmod |
---|
63 | CP = CpCmd |
---|
64 | GREP = grep |
---|
65 | GZIP = GzipCmd |
---|
66 | LN = LnCmd |
---|
67 | MKDIR = MkdirHierCmd |
---|
68 | MV = MvCmd |
---|
69 | RM = RmCmd |
---|
70 | SED = sed |
---|
71 | TAR = tar |
---|
72 | |
---|
73 | MAKE_CHANGELOG = cvs2cl |
---|
74 | |
---|
75 | VERSION = 1.2.4.1 |
---|
76 | DATE = September 17, 2001 |
---|
77 | PROJECT = $(NAME)-$(VERSION) |
---|
78 | DIST_DIR = $(PROJECT) |
---|
79 | DIST = $(PROJECT).tar.gz |
---|
80 | |
---|
81 | HDRS = \@@\ |
---|
82 | drawing.h \@@\ |
---|
83 | dynlist.h \@@\ |
---|
84 | resources.h \@@\ |
---|
85 | x11-ssh-askpass.h |
---|
86 | |
---|
87 | SRCS = \@@\ |
---|
88 | drawing.c \@@\ |
---|
89 | dynlist.c \@@\ |
---|
90 | resources.c \@@\ |
---|
91 | x11-ssh-askpass.c |
---|
92 | |
---|
93 | OBJS = \@@\ |
---|
94 | drawing.o \@@\ |
---|
95 | dynlist.o \@@\ |
---|
96 | resources.o \@@\ |
---|
97 | x11-ssh-askpass.o |
---|
98 | |
---|
99 | MAN_OBJ = $(NAME).man |
---|
100 | MAN_SRC = $(MAN_OBJ).in |
---|
101 | MANS = $(MAN_SRC) |
---|
102 | |
---|
103 | CHANGELOG = ChangeLog |
---|
104 | |
---|
105 | CONFIGURE = configure |
---|
106 | |
---|
107 | IMAKEFILE_OBJ = Imakefile |
---|
108 | IMAKEFILE_SRC = $(IMAKEFILE_OBJ).in |
---|
109 | IMAKEFILES = $(IMAKEFILE_SRC) |
---|
110 | |
---|
111 | DOCS = \@@\ |
---|
112 | README \@@\ |
---|
113 | TODO |
---|
114 | |
---|
115 | APP_DEFAULTS_FILES = \@@\ |
---|
116 | $(CLASS)-1337.ad \@@\ |
---|
117 | $(CLASS)-NeXTish.ad \@@\ |
---|
118 | $(CLASS)-green.ad \@@\ |
---|
119 | $(CLASS)-motif.ad \@@\ |
---|
120 | $(CLASS)-default.ad \@@\ |
---|
121 | |
---|
122 | DIST_FILES = \@@\ |
---|
123 | $(IMAKEFILES) \@@\ |
---|
124 | $(CONFIGURE) \@@\ |
---|
125 | $(DOCS) \@@\ |
---|
126 | $(APP_DEFAULTS_FILES) \@@\ |
---|
127 | $(MANS) \@@\ |
---|
128 | $(SRCS) \@@\ |
---|
129 | $(HDRS) |
---|
130 | |
---|
131 | DIST_EXTRAS = \@@\ |
---|
132 | $(CHANGELOG) \@@\ |
---|
133 | $(IMAKEFILE_OBJ) |
---|
134 | |
---|
135 | LOCAL_LIBRARIES = -lXt -lX11 -lSM -lICE |
---|
136 | |
---|
137 | ComplexProgramTarget($(NAME)) |
---|
138 | |
---|
139 | install:: install-app-defaults |
---|
140 | |
---|
141 | install-app-defaults: $(CLASS).ad |
---|
142 | @if [ -d $(DESTDIR)$(APPDEFDIR) ]; then set +x; \@@\ |
---|
143 | else (set -x; $(MKDIRHIER) $(DESTDIR)$(APPDEFDIR)); fi |
---|
144 | $(INSTALL) $(INSTALLFLAGS) $(INSTAPPFLAGS) $(CLASS).ad \@@\ |
---|
145 | $(DESTDIR)$(APPDEFDIR)/$(CLASS) |
---|
146 | |
---|
147 | install:: |
---|
148 | @set -x; \@@\ |
---|
149 | if [ -f $(DESTDIR)$(BINDIR)/ssh-askpass ]; then \@@\ |
---|
150 | $(MV) $(DESTDIR)$(BINDIR)/ssh-askpass \@@\ |
---|
151 | $(DESTDIR)$(BINDIR)/ssh-askpass.old; \@@\ |
---|
152 | fi |
---|
153 | $(LN) $(NAME) $(DESTDIR)$(BINDIR)/ssh-askpass |
---|
154 | |
---|
155 | install.man:: |
---|
156 | @set -x; \@@\ |
---|
157 | if [ -f $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) ]; then \@@\ |
---|
158 | $(MV) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) \@@\ |
---|
159 | $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX).old; \@@\ |
---|
160 | fi |
---|
161 | $(LN) $(NAME).$(MANSUFFIX) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) |
---|
162 | |
---|
163 | .PHONY: depends changelog realclean squeakyclean spotless tar dist |
---|
164 | |
---|
165 | all:: $(MAN_OBJ) |
---|
166 | |
---|
167 | $(MAN_OBJ): $(MAN_SRC) $(IMAKEFILE_SRC) |
---|
168 | $(SED) \@@\ |
---|
169 | -e 's#@NAME@#$(NAME)#g' \@@\ |
---|
170 | -e 's#@VERSION@#$(VERSION)#g' \@@\ |
---|
171 | -e 's#@DATE@#$(DATE)#g' \@@\ |
---|
172 | <$(MAN_SRC) >$@.tmp |
---|
173 | $(MV) $@.tmp $@ |
---|
174 | |
---|
175 | depends: depend |
---|
176 | |
---|
177 | includes:: $(CLASS)_ad.h |
---|
178 | |
---|
179 | $(CLASS).ad: |
---|
180 | $(LN) $(APP_DEFAULTS) $(CLASS).ad |
---|
181 | |
---|
182 | $(CLASS)_ad.h: $(CLASS).ad |
---|
183 | $(SED) -n '/^[^!]/s/.*/"&",/p' <$(CLASS).ad >$@.tmp |
---|
184 | $(MV) $@.tmp $@ |
---|
185 | |
---|
186 | changelog: $(CHANGELOG) |
---|
187 | $(CHANGELOG): $(DIST_FILES) |
---|
188 | $(MAKE_CHANGELOG) |
---|
189 | |
---|
190 | $(IMAKEFILE_OBJ): $(IMAKEFILE_SRC) |
---|
191 | ./$(CONFIGURE) --defaults |
---|
192 | |
---|
193 | clean:: |
---|
194 | -$(RM) $(CLASS)_ad.h $(MAN_OBJ) |
---|
195 | |
---|
196 | realclean: clean |
---|
197 | -$(RM) $(CLASS).ad |
---|
198 | -$(RM) *.LOG *.log |
---|
199 | |
---|
200 | squeakyclean: realclean |
---|
201 | -$(RM) Makefile Makefile.bak $(IMAKEFILE_OBJ) $(CHANGELOG) |
---|
202 | |
---|
203 | spotless: squeakyclean |
---|
204 | -$(RM) $(DIST) |
---|
205 | |
---|
206 | tar: dist |
---|
207 | dist: $(DIST) |
---|
208 | $(DIST): $(DIST_EXTRAS) $(DIST_FILES) |
---|
209 | -$(RM) -r $(DIST_DIR) |
---|
210 | -$(RM) $@.tmp |
---|
211 | $(MKDIR) $(DIST_DIR) |
---|
212 | $(CP) $(DIST_EXTRAS) $(DIST_FILES) $(DIST_DIR)/ |
---|
213 | $(CHMOD) -R u+rwX,go+rX,go-w $(DIST_DIR) |
---|
214 | $(TAR) -cvf - $(DIST_DIR) |$(GZIP) -9 -c >$@.tmp |
---|
215 | $(MV) $@.tmp $@ |
---|
216 | -$(RM) -r $(DIST_DIR) |
---|
217 | |
---|