update dev300-m57
[ooovba.git] / dmake / startup / startup.mk
blob524ad1efba267b7022f4ee63c56c5f1cd6f18e60
1 # This is the root DMAKE startup file.
3 # Definitions common to all environments are given at the root.
4 # Definitions parameterized at the root have their parameters specified
5 # in sub-makefiles which are included based on the values of the three
6 # make variables:
8 # OS - core operating system flavour
9 # OSRELEASE - specific release of the operating system
10 # OSENVIRONMENT - software construction environment in use
12 # See the file 'summary', found in this directory for a list of
13 # environments supported by this release.
15 # Disable warnings for macros given on the command line but redefined here.
16 __.silent !:= $(.SILENT) # Preserve user's .SILENT flag
17 .SILENT !:= yes
19 # startup.mk configuration parameters, for each, set it to non-null if you wish
20 # to enable the named facility.
21 __.HAVE_RCS !:= yes # yes => RCS is installed.
22 __.HAVE_SCCS !:= # yes => SCCS is installed.
23 __.DEFAULTS !:= yes # yes => define default construction rules.
24 __.EXECS !:= yes # yes => define how to build executables.
26 # Grab key definitions from the environment
27 # The variables OS OSRELEASE OSENVIRONMENT were removed from this
28 # list because of windows. See issue 43254 for details.
29 .IMPORT .IGNORE : TMPDIR SHELL
31 # Default DMAKE configuration, if not overriden by environment
32 .INCLUDE .NOINFER $(!null,$(OS) .IGNORE) : $(INCFILENAME:d)config.mk
34 # Look for a local defaults configuration
35 .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)local.mk
37 # Define the directory separator string.
38 / *= $(DIRSEPSTR)
40 # Customize macro definitions based on setings of OS, OSRELEASE and
41 # OSENVIRONMENT, this must come before the default macro definitions which
42 # follow.
43 .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OS)$/macros.mk
45 # ----------------- Default Control Macro definitions -----------------------
46 # Select appropriate defaults for basic macros
47 MAKE *= $(MAKECMD) -S $(MFLAGS)
48 TMPDIR *:= $/tmp
49 DIVFILE *= $(TMPFILE)
50 AUGMAKE *:= no
52 # Recipe execution configuration
53 SHELL *:= $/bin$/sh
54 SHELLFLAGS *:= -ce
55 GROUPSHELL *:= $(SHELL)
56 GROUPFLAGS *:=
57 SHELLMETAS *:= |();&<>?*][$$:\\#`'"
58 GROUPSUFFIX *:=
60 # Intermediate target removal configuration
61 RM *:= $/bin$/rm
62 RMFLAGS *= -f
63 RMTARGET *= $<
65 # Default recipe that is used to remove intermediate targets.
66 .REMOVE :; $(RM) $(RMFLAGS) $(RMTARGET)
68 # Check and enable AUGMAKE extensions for SYSV compatibility
69 .IF $(AUGMAKE)
70 "@B" != $(@:b)
71 "@D" != $(@:d)
72 "@F" != $(@:f)
73 "*B" != $(*:b)
74 "*D" != $(*:d)
75 "*F" != $(*:f)
76 "<B" != $(<:b)
77 "<D" != $(<:d)
78 "<F" != $(<:f)
79 "?B" != $(?:b)
80 "?F" != $(?:f)
81 "?D" != $(?:d)
82 .ENDIF
84 # Directory caching configuration.
85 .DIRCACHE *:= yes
86 .DIRCACHERESPCASE *:= yes
88 # Define the special NULL Prerequisite
89 NULLPRQ *:= __.NULLPRQ
91 # ---------- Default Construction Macro and Rule definitions --------------
92 # The construction rules may be customized further in subsequent recipes.mk
93 # files.
94 .IF $(__.DEFAULTS)
95 # Primary suffixes in common use
96 A *:= .a # Libraries
97 E *:= # Executables
98 F *:= .f # Fortran
99 O *:= .o # Objects
100 P *:= .p # Pascal
101 S *:= .s # Assembler sources
102 V *:= ,v # RCS suffix
103 YTAB *:= y.tab # name-stem for yacc output files.
104 LEXYY *:= lex.yy # lex output file
106 # Standard C-language command names and flags
107 CPP *:= $/lib$/cpp # C-preprocessor
108 CC *:= cc # C compiler
109 CFLAGS *= # C compiler flags
110 "C++" *:= CC # C++ Compiler
111 "C++FLAGS" *= # C++ Compiler flags
113 AS *:= as # Assembler and flags
114 ASFLAGS *=
116 LD *= $(CC) # Loader and flags
117 LDFLAGS *=
118 LDLIBS *= # Default libraries
120 AR *:= ar # archiver
121 ARFLAGS *= -rv
123 # Definition of Print command for this system.
124 PRINT *= lp
126 # Language and Parser generation Tools and their flags
127 YACC *:= yacc # standard yacc
128 YFLAGS *=
129 LEX *:= lex # standard lex
130 LFLAGS *=
132 # Other Compilers, Tools and their flags
133 PC *:= pc # pascal compiler
134 RC *:= f77 # ratfor compiler
135 FC *:= f77 # fortran compiler
136 MV *:= $/bin$/mv # File rename command
138 # Implicit generation rules for making inferences.
139 # lex and yacc rules
140 %.c : %.y %.Y
141 $(YACC) $(YFLAGS) $<
142 $(MV) $(YTAB).c $@
144 %.c : %.l %.L
145 $(LEX) $(LFLAGS) $<
146 $(MV) $(LEXYY).c $@
148 # Rules for making *$O
149 %$O : %.c ; $(CC) $(CFLAGS) -c $<
150 %$O : %$P ; $(PC) $(PFLAGS) -c $<
151 %$O : %$S ; $(AS) $(ASFLAGS) -o $@ $<
152 %$O : %.cl ; class -c $<
153 %$O :| %.e %.r %.F %$F
154 $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
156 # Defibe how to build simple executables
157 .IF $(__.EXECS)
158 %$E : %$O ; $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS)
159 .ENDIF
161 # Recipe to make archive files, defined only if we have
162 # an archiver defined.
163 .IF $(AR)
164 %$A .SWAP .GROUP :
165 $(AR) $(ARFLAGS) $@ $?
166 $(RM) $(RMFLAGS) $?
167 .ENDIF
169 # RCS support
170 .IF $(__.HAVE_RCS)
171 CO *:= co # check out for RCS
172 COFLAGS !+= -q
174 % : $$(@:d)RCS$$/$$(@:f)$V
175 -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
176 .NOINFER : $$(@:d)RCS$$/$$(@:f)$V
178 .IF $V
179 % : %$V
180 -$(CO) $(COFLAGS) $(null,$(@:d) $@ $(<:d:s/RCS/)$@)
181 .NOINFER : %$V
182 .ENDIF
183 .END
185 # SCCS support
186 .IF $(__.HAVE_SCCS)
187 GET *:= get
188 GFLAGS !+=
190 % : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
191 -$(GET) $(GFLAGS) $@
192 .NOINFER : "$$(null,$$(@:d) s.$$@ $$(@:d)s.$$(@:f))"
193 .END
195 # Customize default recipe definitions for OS, OSRELEASE, etc. settings.
196 .INCLUDE .NOINFER .IGNORE: $(INCFILENAME:d)$(OS)$/recipes.mk
197 .ENDIF
200 # Finally, define the default construction strategy
201 .ROOT .PHONY .NOSTATE .SEQUENTIAL :- .INIT .TARGETS .DONE;
202 .INIT .DONE .PHONY: $(NULLPRQ);
204 # Define the NULL Prerequisite as having no recipe.
205 $(NULLPRQ) .PHONY :;
207 # Reset warnings back to previous setting.
208 .SILENT !:= $(__.silent)
210 # Check for a Local project file, gets parsed before user makefile.
211 .INCLUDE .IGNORE .NOINFER: "project.mk"