[project @ 1997-03-20 12:50:54 by sof]
[ghc-hetmet.git] / mk / paths.mk
1 #################################################################################
2 #
3 #                           paths.mk
4 #
5 #       This file defines Make variables for standard directories
6 #       and file lists
7 #
8 #################################################################################
9
10
11 #-----------------------------------------------------------------
12 #
13 # Installation setup
14 #
15
16 #-----------------------------------------------------------------------------
17 # install configuration
18 #
19 # The install standard target is guided by the following four variables
20 #
21 #  INSTALL_PROGS    (installed in $(bindir))
22 #  INSTALL_LIBS     (installed in $(libdir))
23 #  INSTALL_LIBEXECS (installed in $(libexecdir))
24 #  INSTALL_DATAS    (installed in $(datadir))
25 #
26 # see target.mk for more information.
27 #
28
29 #
30 # Setting user/group ownership for the installed entities
31 #
32 # this stuff about "who" does the installing doesn't have make vars
33 # as it is not intended to be run-time changeable.
34 #
35 ifneq "$(OWNER)" ""
36 INSTALL_OWNER   = -o $(OWNER)
37 else
38 INSTALL_OWNER   =
39 endif
40
41 ifneq "$(GROUP)" ""
42 INSTALL_GROUP   = -g $(GROUP)
43 else
44 INSTALL_GROUP   =
45 endif
46
47 SRC_INSTALL_OPTS += $(INSTALL_OWNER) $(INSTALL_GROUP)
48
49 #
50 # Invocations of `install' for the three different classes
51 # of targets:
52 #
53
54 INSTALL_PROGRAM = $(INSTALL)
55 INSTALL_DATA    = $(INSTALL) -m 644
56 INSTALL_DIR     = $(FPTOOLS_TOP)/glafp-utils/mkdirhier/mkdirhier
57
58 #
59 # The install variables does not have any defaults,
60 # what files to install have to be specified in the Makefiles.
61
62 #INSTALL_PROGS += $(HS_PROG) $(C_PROG)
63 #INSTALL_LIBS  += $(LIBRARY)
64 #INSTALL_DATAS += $(HS_IFACES)
65
66 #-----------------------------------------------------------------------------
67 # Man pages & Documentation
68 #
69 # (AFAIK, not currently used)
70 #
71
72 #man1dir                = $(mandir)/man1
73 #manext          = '.1'
74 #man1ext          = '.1'
75 #man2dir                = $(mandir)/man2
76 #man2ext          = '.2'
77 #man3dir                = $(mandir)/man3
78 #man3ext          = '.3'
79 #man4dir                = $(mandir)/man4
80 #man4ext          = '.4'
81 #man5dir                = $(mandir)/man5
82 #man5ext          = '.5'
83 #man6dir                = $(mandir)/man6
84 #man6ext          = '.6'
85 #man7dir                = $(mandir)/man7
86 #man7ext          = '.7'
87 #man8dir                = $(mandir)/man8
88 #man8ext          = '.8'
89
90 ## top of manual page tree to install in
91 ## NB: not necessarily the same place as to look for man pages (?)
92 #INSTALL_MAN_ROOT = $(mandir)
93
94 ## prefix for man page _sources_ (vs .../cat)
95 #INSTALL_MAN_SRCROOT  = $(INSTALL_MAN_ROOT)/man
96
97 ## man pages for commands
98 #INSTALL_COMMAND_DIR = $(INSTALL_MAN_SRCROOT)$(COMMANSUFFIX)
99
100 ## man pages for library routines
101 #INSTALL_LIB_MANDIR = $(INSTALL_MAN_SRCROOT)$(LIBMANSUFFIX)
102
103 ## man pages for system commands
104 #INSTALL_SYS_MANDIR = $(INSTALL_MAN_SRCROOT)$(SYSMANSUFFIX)
105
106 ## suffix for installing commands'/etcs' man pages
107 #COMMANSUFFIX   = 1
108 #LIBMANSUFFIX   = 3
109 #SYSMANSUFFIX   = 8
110
111 INSTALL_INFO_DIR = $(infodir)
112
113
114 INSTALL_FILE_OPTS =
115 INSTALL_STRIP     =
116 INSTALL_BIN_OPTS  = \
117         -m 0755 $(INSTALL_OWNER) $(INSTALL_GROUP) $(INSTALL_FILE_FLAGS) $(INSTALL_STRIP)
118
119
120
121
122
123 #################################################################################
124 #
125 #               Standard variable names
126 #
127 #################################################################################
128
129 #
130 # The fptools mk setup defines a set of standard names which are used by the standard
131 # targets provided by mk. One example of this is the use of standard names
132 # for specifying what files to compile, their intermediate/object code, and
133 # the name of the final executable. Based on the settings of these variables, the
134 # standard targets will generate/expand rules that automatically compile and
135 # link your program.
136 #
137 # The general rules:
138 #   
139 #   SRCS - sources, might be prefixed to indicate what type of source
140 #          they are.
141 #   OBJS - object files (possibly prefixed).
142 #
143 #   PROG - name of final executable
144 #
145 #
146 #
147 # BOOT_SRCS: list of machine generated Haskell modules.
148 # HS_SRCS:   list of Haskell modules you want to compile.
149 #             (also use by depend rule).
150 # HS_OBJS:   list of corresponding object files
151 # HS_PROG:   program that is ultimately linked.
152 # HS_IFACES: list of interface files generated
153 #             (caveat: assuming no funny use of -hisuf and that
154 #               file name and module name match)
155
156 SRCS=$(wildcard *.lhs *.hs *.c *.lc *.prl *.lprl *.lit *.verb)
157
158 HS_SRCS=$(filter %.lhs %.hs %.hc,$(SRCS))
159 #
160 # Do not include BOOT_SRCS in the HS_SRCS defn above,
161 # since this will make HS_SRCS always be non-empty,
162 # which breaks rules like `depend'. Price is that
163 # you have to define BOOT_SRCS before including
164 # boilerplate.mk
165 #
166 ifneq "$(BOOT_SRCS)" ""
167 HS_SRCS+=$(BOOT_SRCS)
168 endif
169 HS_OBJS=$(addsuffix .$(way_)o,$(basename $(HS_SRCS)))
170 HS_IFACES=$(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
171
172 C_SRCS=$(filter %.lc %.c,$(SRCS))
173 C_OBJS=$(addsuffix .$(way_)o,$(basename $(C_SRCS)))
174
175 # SCRIPT_SRCS:  list of raw script files (in literate form)
176 # SCRIPT_OBJS:  de-litted scripts
177 SCRIPT_SRCS=$(filter %.lprl,$(SRCS))
178 SCRIPT_OBJS=$(addsuffix .prl,$(basename $(SCRIPT_SRCS)))
179
180 OBJS=$(HS_OBJS) $(C_OBJS) $(SCRIPT_OBJS)
181
182 #
183 # Note that as long as you use the standard variables for setting
184 # which C & Haskell programs you want to work on, you don't have
185 # to set any of the clean variables - the default should do the Right
186 # Thing.
187 #
188
189 #------------------------------------------------------------------
190 #
191 # make depend defaults
192 #
193 # The default set of files for the dependency generators to work on
194 # is just their source equivalents.
195
196 MKDEPENDHS_SRCS=$(HS_SRCS)
197 MKDEPENDC_SRCS=$(C_SRCS)
198
199 #------------------------------------------------------------------
200 # Clean file make-variables.
201 #
202 # The following three variables are used to control
203 # what gets removed when doing `make clean' 
204 #
205 # MOSTLYCLEAN_FILES   object code etc., but not stuff
206 #                     that is slow to recompile and/or stable
207 #
208 # CLEAN_FILES  all files that are created by running make.
209 #
210 # MAINTAINER_CLEAN_FILES also clean out machine-generated files
211 #                        that may require extra tools to create.
212 #
213 #
214 MOSTLY_CLEAN_FILES     += $(HS_OBJS) $(C_OBJS)
215 CLEAN_FILES            += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(PROG) $(LIBRARY) \
216                           $(HS_IFACES) \
217                           a.out core
218 MAINTAINER_CLEAN_FILES += .depend $(BOOT_SRCS)
219
220 #
221 # `Standard' set of files to clean out.
222 #
223 MOSTLY_CLEAN_FILES += \
224  *.CKP *.ln *.BAK *.bak *.o core a.out errs ,* *.a .emacs_*          \
225  tags TAGS *.ind *.ilg *.idx *.idx-prev *.aux *.aux-prev *.dvi *.log \
226  *.toc *.lot *.lof *.blg *.info *.itxi *.itex *.ihtml *.cb
227
228 #------------------------------------------------------------------
229 # Documentation setup.
230 #
231 # Documentation is not normally produced via the default target, but
232 # selectively through a set of standard targets (e.g, dvi, html, etc., see
233 # target.mk). Here we define the variables (and their default settings),
234 # that control the operation of these standard targets.
235 #
236 # Documentation variables:
237 #
238 #  DOC_SRCS  = list of documents you want to generate various
239 #              forms of documentation from.
240 #  DOC_DVI   = list of DVI files to generate.
241 #  DOC_HTML  = list of HTML files to generate
242 #  DOC_TEXI  = list of TexInfo files to generate
243 #  DOC_TEXT  = list of simple text files to generate
244
245 DOC_SRCS=$(wildcard    *.tex *.lit)
246 DOC_DVI =$(addsuffix  .dvi,$(basename $(DOC_SRCS)))
247 DOC_PS  =$(addsuffix   .ps,$(basename $(DOC_SRCS)))
248 DOC_TEXI=$(addsuffix .texi,$(basename $(DOC_SRCS)))
249 DOC_HTML=$(addsuffix .html,$(basename $(DOC_SRCS)))
250 DOC_TEXT=$(addsuffix .txt,$(basename $(DOC_SRCS)))
251
252 CLEAN_FILES += $(DOC_TEXT) $(DOC_HTML) $(DOC_TEXI) $(DOC_PS) $(DOC_DVI)
253
254 #------------------------------------------------------------------
255 #
256 # Distribution setup
257
258 # Following variables are used for creating source and binary distributions:
259 #
260 #  SRC_DIST_NAME && BIN_DIST_NAME  -- the package names
261 #
262 #  SRC_DIST_FILES = list of extra files to include from a build tree into a source
263 #                   distribution
264 #  
265 #  SRC_DIST_DIR  = what the current directory in the source/build tree
266 #                  maps to in the source distrib. tree being created.
267 #
268 SRC_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
269
270 #
271 # Binary distributions proceeds as follows:
272 #
273 # Fromthe top of a build tree, you do `make binary-dist'. The
274 # canned rule for this  (in target.mk) will then do a binary
275 # install to a temporary directory before packaging it all up.
276 # The following variables guide the binary-dist:
277 #
278 #  BIN_DIST_TMPDIR= the absolute path to where the temporary directory
279 #                   structure of a binary distribution should be created.
280 #                   [Default: toplevel from which you issue `make binary-dist']
281 #  BIN_DIST_NAME=   what to call the thing.
282 #
283 #  BIN_DIST_DIRS=   at the toplevel, list of directories to descend into when
284 #                   building the distribution tree.
285 #  
286 #  An extra directory variable that is set during bin-dists is $(bindist_top), giving
287 #  the abs. path to the root of the binary installation tree. (useful when punting
288 #  stuff like README and ANNOUNCE into a distrib, for instance)
289 #
290 #  The layout of a binary distribution is described in the
291 #  installation documentation.
292 #
293
294