[project @ 1997-03-14 07:52:06 by simonpj]
[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))$(BOOT_SRCS)
159 HS_OBJS=$(addsuffix .$(way_)o,$(basename $(HS_SRCS)))
160 HS_IFACES=$(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
161
162 C_SRCS=$(filter %.lc %.c,$(SRCS))
163 C_OBJS=$(addsuffix .$(way_)o,$(basename $(C_SRCS)))
164
165 # SCRIPT_SRCS:  list of raw script files (in literate form)
166 # SCRIPT_OBJS:  de-litted scripts
167 SCRIPT_SRCS=$(filter %.lprl,$(SRCS))
168 SCRIPT_OBJS=$(addsuffix .prl,$(basename $(SCRIPT_SRCS)))
169
170 OBJS=$(HS_OBJS) $(C_OBJS) $(SCRIPT_OBJS)
171
172 #
173 # Note that as long as you use the standard variables for setting
174 # which C & Haskell programs you want to work on, you don't have
175 # to set any of the clean variables - the default should do the Right
176 # Thing.
177 #
178
179 #------------------------------------------------------------------
180 # Clean file make-variables.
181 #
182 # The following three variables are used to control
183 # what gets removed when doing `make clean' 
184 #
185 # MOSTLYCLEAN_FILES   object code etc., but not stuff
186 #                     that is slow to recompile and/or stable
187 #
188 # CLEAN_FILES  all files that are created by running make.
189 #
190 # MAINTAINER_CLEAN_FILES also clean out machine-generated files
191 #                        that may require extra tools to create.
192 #
193 #
194 MOSTLY_CLEAN_FILES     += $(HS_OBJS) $(C_OBJS)
195 CLEAN_FILES            += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(PROG) $(LIBRARY) \
196                           $(HS_IFACES) \
197                           a.out core
198 MAINTAINER_CLEAN_FILES += .depend $(BOOT_SRCS)
199
200 #
201 # `Standard' set of files to clean out.
202 #
203 MOSTLY_CLEAN_FILES += \
204  *.CKP *.ln *.BAK *.bak *.o core a.out errs ,* *.a .emacs_*          \
205  tags TAGS *.ind *.ilg *.idx *.idx-prev *.aux *.aux-prev *.dvi *.log \
206  *.toc *.lot *.lof *.blg *.info *.itxi *.itex *.ihtml *.cb
207
208 #------------------------------------------------------------------
209 # Documentation setup.
210 #
211 # Documentation is not normally produced via the default target, but
212 # selectively through a set of standard targets (e.g, dvi, html, etc., see
213 # target.mk). Here we define the variables (and their default settings),
214 # that control the operation of these standard targets.
215 #
216 # Documentation variables:
217 #
218 #  DOC_SRCS  = list of documents you want to generate various
219 #              forms of documentation from.
220 #  DOC_DVI   = list of DVI files to generate.
221 #  DOC_HTML  = list of HTML files to generate
222 #  DOC_TEXI  = list of TexInfo files to generate
223 #  DOC_TEXT  = list of simple text files to generate
224
225 DOC_SRCS=$(wildcard    *.tex *.lit)
226 DOC_DVI =$(addsuffix  .dvi,$(basename $(DOC_SRCS)))
227 DOC_PS  =$(addsuffix   .ps,$(basename $(DOC_SRCS)))
228 DOC_TEXI=$(addsuffix .texi,$(basename $(DOC_SRCS)))
229 DOC_HTML=$(addsuffix .html,$(basename $(DOC_SRCS)))
230 DOC_TEXT=$(addsuffix .txt,$(basename $(DOC_SRCS)))
231
232 CLEAN_FILES += $(DOC_TEXT) $(DOC_HTML) $(DOC_TEXI) $(DOC_PS) $(DOC_DVI)
233
234 #------------------------------------------------------------------
235 #
236 # Distribution setup
237
238 # Following variables are used for creating source and binary distributions:
239 #
240 #  SRC_DIST_NAME && BIN_DIST_NAME  -- the package names
241 #
242 #  SRC_DIST_FILES = list of extra files to include from a build tree into a source
243 #                   distribution
244 #  
245 #  SRC_DIST_DIR  = what the current directory in the source/build tree
246 #                  maps to in the source distrib. tree being created.
247 #
248 SRC_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
249
250 #
251 # Binary distributions proceeds as follows:
252 #
253 # Fromthe top of a build tree, you do `make binary-dist'. The
254 # canned rule for this  (in target.mk) will then do a binary
255 # install to a temporary directory before packaging it all up.
256 # The following variables guide the binary-dist:
257 #
258 #  BIN_DIST_TMPDIR= the absolute path to where the temporary directory
259 #                   structure of a binary distribution should be created.
260 #                   [Default: toplevel from which you issue `make binary-dist']
261 #  BIN_DIST_NAME=   what to call the thing.
262 #
263 #  BIN_DIST_DIRS=   at the toplevel, list of directories to descend into when
264 #                   building the distribution tree.
265 #  
266 #  An extra directory variable that is set during bin-dists is $(bindist_top), giving
267 #  the abs. path to the root of the binary installation tree. (useful when punting
268 #  stuff like README and ANNOUNCE into a distrib, for instance)
269 #
270 #  The layout of a binary distribution is described in the
271 #  installation documentation.
272 #
273
274