1 #################################################################################
5 # This file defines Make variables for standard directories
8 #################################################################################
11 #-----------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 # install configuration
19 # The install standard target is guided by the following four variables
21 # INSTALL_PROGS (installed in $(bindir))
22 # INSTALL_LIBS (installed in $(libdir))
23 # INSTALL_LIBEXECS (installed in $(libexecdir))
24 # INSTALL_DATAS (installed in $(datadir))
26 # see target.mk for more information.
30 # Setting user/group ownership for the installed entities
32 # this stuff about "who" does the installing doesn't have make vars
33 # as it is not intended to be run-time changeable.
36 INSTALL_OWNER = -o $(OWNER)
42 INSTALL_GROUP = -g $(GROUP)
47 SRC_INSTALL_OPTS += $(INSTALL_OWNER) $(INSTALL_GROUP)
50 # Invocations of `install' for the three different classes
54 INSTALL_PROGRAM = $(INSTALL) -m 755
55 INSTALL_SCRIPT = $(INSTALL) -m 755
56 INSTALL_DATA = $(INSTALL) -m 644
57 INSTALL_DIR = $(FPTOOLS_TOP)/glafp-utils/mkdirhier/mkdirhier
60 # The install variables does not have any defaults,
61 # what files to install have to be specified in the Makefiles.
63 #INSTALL_PROGS += $(HS_PROG) $(C_PROG)
64 #INSTALL_LIBS += $(LIBRARY)
65 #INSTALL_DATAS += $(HS_IFACES)
67 #################################################################################
69 # Standard variable names
71 #################################################################################
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
83 # SRCS - sources, might be prefixed to indicate what type of source
85 # OBJS - object files (possibly prefixed).
87 # PROG - name of final executable
89 # We attempt to automatically devine the list of sources $(SRCS) to
90 # compile by looking in the current directory. This is complicated by
91 # the fact that a .hsc file gives rise to a .hs file (which needs to
92 # be automatically included in $(SRCS)), but the .hs file might
93 # already be present in the current directory and we don't want to
96 # So we figure out the sources in three stages: first figure out
97 # what's in the current directory. Then figure out all the "derived"
98 # sources (eg. A.hsc generates A.hs and A_hsc.c), and finally put all
99 # these together and remove duplicates (GNU make's handy sort function
100 # does the duplicate removing).
102 # BOOT_SRCS: list of machine generated Haskell modules.
103 # HS_SRCS: list of Haskell modules you want to compile.
104 # (also use by depend rule).
105 # HS_OBJS: list of corresponding object files
106 # HS_PROG: program that is ultimately linked.
107 # HS_IFACES: list of interface files generated
108 # (caveat: assuming no funny use of -hisuf and that
109 # file name and module name match)
111 PRE_SRCS = $(wildcard *.lhs *.hs *.c *.prl *.lprl *.lit *.verb *.hsc)
113 HSC_SRCS = $(filter %.hsc, $(PRE_SRCS))
114 HSC_HS_SRCS = $(patsubst %.hsc,%.hs,$(HSC_SRCS))
115 HSC_C_SRCS = $(patsubst %.hsc,%_hsc.c,$(HSC_SRCS))
116 HSC_C_OBJS = $(patsubst %.hsc,%_hsc.o,$(HSC_SRCS))
118 SRCS = $(sort $(PRE_SRCS) $(HSC_HS_SRCS) $(HSC_C_SRCS))
120 HS_SRCS = $(filter %.lhs %.hs %.hc,$(sort $(SRCS) $(BOOT_SRCS)))
121 HS_OBJS = $(addsuffix .$(way_)o,$(basename $(HS_SRCS)))
122 HS_HCS = $(addsuffix .$(way_)hc,$(basename $(HS_SRCS)))
123 HS_SS = $(addsuffix .$(way_)s,$(basename $(HS_SRCS)))
124 HS_IFACES = $(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
126 C_SRCS = $(filter %.c,$(SRCS))
127 C_OBJS = $(addsuffix .$(way_)o,$(basename $(C_SRCS)))
129 # SCRIPT_SRCS: list of raw script files (in literate form)
130 # SCRIPT_OBJS: de-litted scripts
131 SCRIPT_SRCS=$(filter %.lprl,$(SRCS))
132 SCRIPT_OBJS=$(addsuffix .prl,$(basename $(SCRIPT_SRCS)))
134 OBJS=$(HS_OBJS) $(C_OBJS) $(SCRIPT_OBJS)
137 # Note that as long as you use the standard variables for setting
138 # which C & Haskell programs you want to work on, you don't have
139 # to set any of the clean variables - the default should do the Right
143 #------------------------------------------------------------------
145 # make depend defaults
147 # The default set of files for the dependency generators to work on
148 # is just their source equivalents.
151 ifneq "$(BootingFromHc)" "YES"
152 MKDEPENDHS_SRCS=$(HS_SRCS)
157 MKDEPENDC_SRCS=$(C_SRCS)
159 #------------------------------------------------------------------
163 # The default set of files for the dependency generators to work on
164 # is just their source equivalents.
166 TAGS_HS_SRCS=$(HS_SRCS)
167 TAGS_C_SRCS=$(C_SRCS)
169 #------------------------------------------------------------------
170 # Clean file make-variables.
172 # The following three variables are used to control
173 # what gets removed when doing `make clean'
175 # MOSTLYCLEAN_FILES object code etc., but not stuff
176 # that is slow to recompile and/or stable
178 # CLEAN_FILES all files that are created by running make.
180 # MAINTAINER_CLEAN_FILES also clean out machine-generated files
181 # that may require extra tools to create.
184 MOSTLY_CLEAN_FILES += $(HS_OBJS) $(C_OBJS)
185 CLEAN_FILES += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(SCRIPT_LINK) \
186 $(PROG) $(LIBRARY) $(HS_IFACES) $(HS_SS) a.out \
187 $(patsubst %.hsc,%.hs,$(HSC_SRCS)) \
188 $(patsubst %.hsc,%_hsc.c,$(HSC_SRCS)) \
189 $(patsubst %.hsc,%_hsc.h,$(HSC_SRCS))
191 # Don't clean the .hc files if we're bootstrapping
192 ifneq "$(BootingFromHc)" "YES"
193 CLEAN_FILES += $(HS_HCS)
196 DIST_CLEAN_FILES += .depend
197 MAINTAINER_CLEAN_FILES += $(BOOT_SRCS)
200 # `Standard' set of files to clean out.
202 MOSTLY_CLEAN_FILES += \
203 *.CKP *.ln *.BAK *.bak .*.bak *.o *core a.out errs ,* *.a .emacs_* \
204 tags TAGS *.ind *.ilg *.idx *.idx-prev *.aux *.aux-prev *.dvi *.log \
205 *.toc *.lot *.lof *.blg *.cb *_stub.c *_stub.h *.raw_s
207 #------------------------------------------------------------------
211 # Following variables are used for creating source and binary distributions:
213 # SRC_DIST_NAME && BIN_DIST_NAME -- the package names
215 # SRC_DIST_FILES = list of extra files to include from a build tree into a source
218 # SRC_DIST_DIR = what the current directory in the source/build tree
219 # maps to in the source distrib. tree being created.
221 SRC_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
224 # Binary distributions proceeds as follows:
226 # Fromthe top of a build tree, you do `make binary-dist'. The
227 # canned rule for this (in target.mk) will then do a binary
228 # install to a temporary directory before packaging it all up.
229 # The following variables guide the binary-dist:
231 # BIN_DIST_TMPDIR= the absolute path to where the temporary directory
232 # structure of a binary distribution should be created.
233 # [Default: toplevel from which you issue `make binary-dist']
234 # BIN_DIST_NAME= what to call the thing.
236 # BIN_DIST_DIRS= at the toplevel, list of directories to descend into when
237 # building the distribution tree.
239 # An extra directory variable that is set during bin-dists is $(bindist_top), giving
240 # the abs. path to the root of the binary installation tree. (useful when punting
241 # stuff like README and ANNOUNCE into a distrib, for instance)
243 # The layout of a binary distribution is described in the
244 # installation documentation.
248 # Directory in which DLLs are dumped so as not to get picked up by running
249 # programs (e.g. ghc or hsc) that run in the build tree
251 DLL_PEN = $(FPTOOLS_TOP)/dll