[project @ 1997-09-04 19:50:29 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_SCRIPT  = $(INSTALL)
56 INSTALL_DATA    = $(INSTALL) -m 644
57 INSTALL_DIR     = $(FPTOOLS_TOP)/glafp-utils/mkdirhier/mkdirhier
58
59 #
60 # The install variables does not have any defaults,
61 # what files to install have to be specified in the Makefiles.
62
63 #INSTALL_PROGS += $(HS_PROG) $(C_PROG)
64 #INSTALL_LIBS  += $(LIBRARY)
65 #INSTALL_DATAS += $(HS_IFACES)
66
67 #################################################################################
68 #
69 #               Standard variable names
70 #
71 #################################################################################
72
73 #
74 # The fptools mk setup defines a set of standard names which are used by the standard
75 # targets provided by mk. One example of this is the use of standard names
76 # for specifying what files to compile, their intermediate/object code, and
77 # the name of the final executable. Based on the settings of these variables, the
78 # standard targets will generate/expand rules that automatically compile and
79 # link your program.
80 #
81 # The general rules:
82 #   
83 #   SRCS - sources, might be prefixed to indicate what type of source
84 #          they are.
85 #   OBJS - object files (possibly prefixed).
86 #
87 #   PROG - name of final executable
88 #
89 #
90 #
91 # BOOT_SRCS: list of machine generated Haskell modules.
92 # HS_SRCS:   list of Haskell modules you want to compile.
93 #             (also use by depend rule).
94 # HS_OBJS:   list of corresponding object files
95 # HS_PROG:   program that is ultimately linked.
96 # HS_IFACES: list of interface files generated
97 #             (caveat: assuming no funny use of -hisuf and that
98 #               file name and module name match)
99
100 SRCS=$(wildcard *.lhs *.hs *.c *.lc *.prl *.lprl *.lit *.verb)
101
102 HS_SRCS=$(filter %.lhs %.hs %.hc,$(SRCS) $(BOOT_SRCS))
103 HS_OBJS=$(addsuffix .$(way_)o,$(basename $(HS_SRCS)))
104 HS_IFACES=$(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
105
106 C_SRCS=$(filter %.lc %.c,$(SRCS))
107 C_OBJS=$(addsuffix .$(way_)o,$(basename $(C_SRCS)))
108
109 # SCRIPT_SRCS:  list of raw script files (in literate form)
110 # SCRIPT_OBJS:  de-litted scripts
111 SCRIPT_SRCS=$(filter %.lprl,$(SRCS))
112 SCRIPT_OBJS=$(addsuffix .prl,$(basename $(SCRIPT_SRCS)))
113
114 OBJS=$(HS_OBJS) $(C_OBJS) $(SCRIPT_OBJS)
115
116 #
117 # Note that as long as you use the standard variables for setting
118 # which C & Haskell programs you want to work on, you don't have
119 # to set any of the clean variables - the default should do the Right
120 # Thing.
121 #
122
123 #------------------------------------------------------------------
124 #
125 # make depend defaults
126 #
127 # The default set of files for the dependency generators to work on
128 # is just their source equivalents.
129
130 MKDEPENDHS_SRCS=$(HS_SRCS)
131 MKDEPENDC_SRCS=$(C_SRCS)
132
133 #------------------------------------------------------------------
134 #
135 # make TAGS defaults
136 #
137 # The default set of files for the dependency generators to work on
138 # is just their source equivalents.
139
140 TAGS_HS_SRCS=$(HS_SRCS)
141 TAGS_C_SRCS=$(C_SRCS)
142
143 #------------------------------------------------------------------
144 # Clean file make-variables.
145 #
146 # The following three variables are used to control
147 # what gets removed when doing `make clean' 
148 #
149 # MOSTLYCLEAN_FILES   object code etc., but not stuff
150 #                     that is slow to recompile and/or stable
151 #
152 # CLEAN_FILES  all files that are created by running make.
153 #
154 # MAINTAINER_CLEAN_FILES also clean out machine-generated files
155 #                        that may require extra tools to create.
156 #
157 #
158 MOSTLY_CLEAN_FILES     += $(HS_OBJS) $(C_OBJS)
159 CLEAN_FILES            += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(PROG) $(LIBRARY) \
160                           $(HS_IFACES) \
161                           a.out core
162 MAINTAINER_CLEAN_FILES += .depend $(BOOT_SRCS)
163
164 #
165 # `Standard' set of files to clean out.
166 #
167 MOSTLY_CLEAN_FILES += \
168  *.CKP *.ln *.BAK *.bak *.o *.hc core a.out errs ,* *.a .emacs_*             \
169  tags TAGS *.ind *.ilg *.idx *.idx-prev *.aux *.aux-prev *.dvi *.log \
170  *.toc *.lot *.lof *.blg *.info *.itxi *.itex *.ihtml *.cb
171
172 #------------------------------------------------------------------
173 # Documentation setup.
174 #
175 # Documentation is not normally produced via the default target, but
176 # selectively through a set of standard targets (e.g, dvi, html, etc., see
177 # target.mk). Here we define the variables (and their default settings),
178 # that control the operation of these standard targets.
179 #
180 # Documentation variables:
181 #
182 #  DOC_SRCS  = list of documents you want to generate various
183 #              forms of documentation from.
184 #  DOC_DVI   = list of DVI files to generate.
185 #  DOC_HTML  = list of HTML files to generate
186 #  DOC_TEXI  = list of TexInfo files to generate
187 #  DOC_INFO  = list of Emacs Info files to generate
188 #  DOC_TEXT  = list of simple text files to generate
189
190 DOC_SRCS=$(wildcard    *.tex *.lit)
191 DOC_DVI =$(addsuffix  .dvi,$(basename $(DOC_SRCS)))
192 DOC_PS  =$(addsuffix   .ps,$(basename $(DOC_SRCS)))
193 DOC_TEXI=$(addsuffix .texi,$(basename $(DOC_SRCS)))
194 DOC_INFO=$(addsuffix .info,$(basename $(DOC_SRCS)))
195 DOC_HTML=$(addsuffix .html,$(basename $(DOC_SRCS)))
196 DOC_TEXT=$(addsuffix .txt,$(basename $(DOC_SRCS)))
197 CLEAN_FILES += $(DOC_TEXT) $(DOC_HTML) $(DOC_TEXI) $(DOC_PS) $(DOC_DVI)
198
199 #------------------------------------------------------------------
200 #
201 # Distribution setup
202
203 # Following variables are used for creating source and binary distributions:
204 #
205 #  SRC_DIST_NAME && BIN_DIST_NAME  -- the package names
206 #
207 #  SRC_DIST_FILES = list of extra files to include from a build tree into a source
208 #                   distribution
209 #  
210 #  SRC_DIST_DIR  = what the current directory in the source/build tree
211 #                  maps to in the source distrib. tree being created.
212 #
213 SRC_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
214
215 #
216 # Binary distributions proceeds as follows:
217 #
218 # Fromthe top of a build tree, you do `make binary-dist'. The
219 # canned rule for this  (in target.mk) will then do a binary
220 # install to a temporary directory before packaging it all up.
221 # The following variables guide the binary-dist:
222 #
223 #  BIN_DIST_TMPDIR= the absolute path to where the temporary directory
224 #                   structure of a binary distribution should be created.
225 #                   [Default: toplevel from which you issue `make binary-dist']
226 #  BIN_DIST_NAME=   what to call the thing.
227 #
228 #  BIN_DIST_DIRS=   at the toplevel, list of directories to descend into when
229 #                   building the distribution tree.
230 #  
231 #  An extra directory variable that is set during bin-dists is $(bindist_top), giving
232 #  the abs. path to the root of the binary installation tree. (useful when punting
233 #  stuff like README and ANNOUNCE into a distrib, for instance)
234 #
235 #  The layout of a binary distribution is described in the
236 #  installation documentation.
237 #
238
239