| 1 | /* |
| 2 | * Generic jmake template |
| 3 | * |
| 4 | * $Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ |
| 5 | * |
| 6 | * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi |
| 7 | * |
| 8 | * You may redistribute only under the terms of the Artistic Licence, |
| 9 | * as specified in the README file that comes with the distribution. |
| 10 | * You may reuse parts of this distribution only within the terms of |
| 11 | * that same Artistic Licence; a copy of which may be found at the root |
| 12 | * of the source tree for dist 4.0. |
| 13 | * |
| 14 | * $Log: Jmake.tmpl,v $ |
| 15 | * Revision 3.0.1.3 1997/02/28 14:56:16 ram |
| 16 | * patch61: lex path can now be configured |
| 17 | * |
| 18 | * Revision 3.0.1.2 1995/01/11 14:50:21 ram |
| 19 | * patch45: now pre-computes INSTALL and INSTALLDIR variables |
| 20 | * |
| 21 | * Revision 3.0.1.1 1993/08/20 07:36:36 ram |
| 22 | * patch3: config.sh searching was not aborting properly |
| 23 | * |
| 24 | * Revision 3.0 1993/08/18 12:04:16 ram |
| 25 | * Baseline for dist 3.0 netwide release. |
| 26 | * |
| 27 | */ |
| 28 | |
| 29 | : Makefile.SH generated from Jmake.tmpl and Jmakefile <TAG> |
| 30 | : $Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ |
| 31 | |
| 32 | /************************************************************************* |
| 33 | * * |
| 34 | * DO NOT MODIFY BELOW THIS LINE * |
| 35 | * * |
| 36 | *************************************************************************/ |
| 37 | |
| 38 | case $CONFIG in |
| 39 | '') |
| 40 | if test -f config.sh; then TOP=.; |
| 41 | elif test -f ../config.sh; then TOP=..; |
| 42 | elif test -f ../../config.sh; then TOP=../..; |
| 43 | elif test -f ../../../config.sh; then TOP=../../..; |
| 44 | elif test -f ../../../../config.sh; then TOP=../../../..; |
| 45 | else |
| 46 | echo "Can't find config.sh."; exit 1 |
| 47 | fi |
| 48 | . $TOP/config.sh |
| 49 | ;; |
| 50 | esac |
| 51 | case "$0" in |
| 52 | */#*) cd `expr X$0 : 'X\(.*\)/'` ;; |
| 53 | esac |
| 54 | |expand cur!CURDIR! |
| 55 | CURRENT=!cur:^\./= |
| 56 | -expand |
| 57 | DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` |
| 58 | echo "Extracting ${DIR}Makefile (with variable substitutions)" |
| 59 | /* |
| 60 | * Variable pre-computation. |
| 61 | */ |
| 62 | ?INSTALL:INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'` |
| 63 | ?INSTALLDIR:INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'` |
| 64 | DATE=`date` |
| 65 | /* |
| 66 | * Makefile generation. |
| 67 | */ |
| 68 | $spitshell >Makefile <<!GROK!THIS! |
| 69 | ;######################################################################## |
| 70 | ;# Makefile generated from Makefile.SH on $DATE |
| 71 | |
| 72 | SHELL = /bin/sh |
| 73 | JMAKE = jmake |
| 74 | TOP = TOPDIR |
| 75 | CURRENT = $CURRENT |
| 76 | DIR = $DIR |
| 77 | ?INSTALL:INSTALL = $INSTALL |
| 78 | ?INSTALLDIR:INSTALLDIR = $INSTALLDIR |
| 79 | |
| 80 | ;######################################################################## |
| 81 | ;# Parameters set by Configure -- edit config.sh if changes are needed |
| 82 | |
| 83 | ?AR:AR = ar rc /* FIXME */ |
| 84 | ?BINDIR:BINDIR = $installbin |
| 85 | ?CC:CC = $cc |
| 86 | ?CHMOD:CHMOD = $chmod |
| 87 | ?CP:CP = $cp |
| 88 | ?CPP:CPP = $cpp $cppminus $cppflags |
| 89 | ?CTAGS:CTAGS = ctags /* FIXME */ |
| 90 | ?_EXE:_EXE = $_exe |
| 91 | ?INSTALLPREFIX:INSTALLPREFIX = $prefix |
| 92 | ?JCFLAGS:JCFLAGS = \$(CFLAGS) $optimize $ccflags $large |
| 93 | ?JCPPFLAGS:JCPPFLAGS = $cppflags |
| 94 | ?JLDFLAGS:JLDFLAGS = \$(LDFLAGS) $optimize $ldflags |
| 95 | ?JLFLAGS:JLFLAGS = \$(LFLAGS) |
| 96 | ?JYFLAGS:JYFLAGS = \$(YFLAGS) $yaccflags |
| 97 | ?L:L = $manext |
| 98 | ?LD:LD = ld |
| 99 | ?LEX:LEX = $lex |
| 100 | ?LIBS:LIBS = $libs |
| 101 | ?LINT:LINT = lint |
| 102 | ?LN:LN = $ln |
| 103 | ?MANSRC:MANSRC = $installmansrc |
| 104 | ?MAKE:$make_set_make |
| 105 | ?MKDEP:MKDEP = $mkdep \$(DPFLAGS) \$(JCPPFLAGS) -- |
| 106 | ?MV:MV = $mv |
| 107 | ?PRIVLIB:PRIVLIB = $installprivlib |
| 108 | ?RANLIB:RANLIB = $ranlib |
| 109 | ?RM:RM = $rm -f |
| 110 | ?SCRIPTDIR:SCRIPTDIR = $installscript |
| 111 | ?SED:SED = $sed |
| 112 | ?YACC:YACC = $yacc |
| 113 | |
| 114 | /* |
| 115 | * The following will only be added if at least one initialization |
| 116 | * rule was found in the Jmakefile. |
| 117 | */ |
| 118 | %INIT:|skip /* Skip if no initializations are necessary */ |
| 119 | ;######################################################################## |
| 120 | ;# Automatically generated parameters -- do not edit |
| 121 | |
| 122 | INIT_SECTION |
| 123 | |
| 124 | -skip /* Initializations */ |
| 125 | %SUFFIX:|skip /* Skip if no suffixes/rules are defined */ |
| 126 | ;######################################################################## |
| 127 | ;# New suffixes and associated building rules -- edit with care |
| 128 | |
| 129 | SUFFIX_SECTION |
| 130 | -skip /* Suffixes/Rules */ |
| 131 | !GROK!THIS! |
| 132 | $spitshell >>Makefile <<'!NO!SUBS!' |
| 133 | #include <Jmake.rules> |
| 134 | |
| 135 | %MKDEP:|skip /* Skip if no depend target */ |
| 136 | ;######################################################################## |
| 137 | ;# Force 'make depend' to be performed first -- do not edit |
| 138 | |
| 139 | .FORCE_DEPEND:: |
| 140 | |
| 141 | all:: .FORCE_DEPEND |
| 142 | |
| 143 | -skip /* Depend target */ |
| 144 | ;######################################################################## |
| 145 | ;# Start of Jmakefile |
| 146 | #include <Jmakefile> |
| 147 | |
| 148 | ;######################################################################## |
| 149 | ;# Common rules for all Makefiles -- do not edit |
| 150 | /* |
| 151 | * These need to be here so that rules in Jmakefile occur first; the blank |
| 152 | * all is to make sure that an empty Jmakefile doesn't default to make clean. |
| 153 | */ |
| 154 | all:: |
| 155 | |
| 156 | CleanTarget() |
| 157 | InstallTarget() |
| 158 | |
| 159 | /* |
| 160 | * The installation of manual pages is optional. When they say "none" in |
| 161 | * Configure, then they don't want any manual page and $installmansrc will |
| 162 | * be empty. |
| 163 | * |
| 164 | * To avoid protecting all the jmake rules for an empty destination, we use |
| 165 | * this clever hack: there is an "install.man-no" and an "install.man-yes" |
| 166 | * target defined, where the first does nothing and the second triggers |
| 167 | * the local install. The same goes for deinstall. |
| 168 | * |
| 169 | * If the `MANSRC' symbol is not wanted, then there is no manual page |
| 170 | * and we can force the -no version of the targets. |
| 171 | */ |
| 172 | %MANSRC:|skip /* Skip if no manual targets */ |
| 173 | !NO!SUBS! |
| 174 | case "$installmansrc" in |
| 175 | '') man=no;; |
| 176 | *) man=yes;; |
| 177 | esac |
| 178 | $spitshell >>Makefile <<!GROK!THIS! |
| 179 | maybe_install.man: install.man-$man |
| 180 | maybe_deinstall.man: deinstall.man-$man |
| 181 | !GROK!THIS! |
| 182 | $spitshell >>Makefile <<'!NO!SUBS!' |
| 183 | -skip |
| 184 | ?MANSRC:|skip /* Skip if it has manual targets */ |
| 185 | maybe_install.man: install.man-no |
| 186 | maybe_deinstall.man: deinstall.man-no |
| 187 | -skip |
| 188 | |
| 189 | MakefileTarget() |
| 190 | TagsTarget() |
| 191 | |
| 192 | %SUBDIRS:|skip /* Skip if no sub-directories */ |
| 193 | ;######################################################################## |
| 194 | ;# Rules for building in sub-directories -- do not edit |
| 195 | |
| 196 | CommonSubdirsRule($(SUBDIRS)) |
| 197 | InstallSubdirs() |
| 198 | InstallManSubdirs() |
| 199 | CleanSubdirs() |
| 200 | TagSubdirs($(SUBDIRS)) |
| 201 | MakefileSubdirs() |
| 202 | MakeSubdirs() |
| 203 | |
| 204 | /* |
| 205 | * Empty rules in case they don't define anything to be installed |
| 206 | * in this directory. |
| 207 | */ |
| 208 | local_install:: |
| 209 | local_deinstall:: |
| 210 | local_install.man:: |
| 211 | local_deinstall.man:: |
| 212 | |
| 213 | -skip /* Sub-directories */ |
| 214 | ?SUBDIRS:|skip /* Skip if sub-directories */ |
| 215 | ;######################################################################## |
| 216 | ;# Empty rules for directories with no sub-directories -- do not edit |
| 217 | |
| 218 | local_install:: |
| 219 | @echo "install in $(CURRENT) done." |
| 220 | |
| 221 | local_deinstall:: |
| 222 | @echo "deinstall in $(CURRENT) done." |
| 223 | |
| 224 | local_install.man:: |
| 225 | @echo "install.man in $(CURRENT) done." |
| 226 | |
| 227 | local_deinstall.man:: |
| 228 | @echo "deinstall.man in $(CURRENT) done." |
| 229 | |
| 230 | /* |
| 231 | * Action for 'Makefiles' would be required, if a .SUFFIXES: .SH rule |
| 232 | * were added, because in that case, a "/bin/sh Makefiles.SH" would |
| 233 | * be issued and raise an error. |
| 234 | */ |
| 235 | Makefiles:: |
| 236 | |
| 237 | Makefiles.SH:: |
| 238 | |
| 239 | -skip /* No sub-directories */ |
| 240 | %MKDEP:|skip /* Skip if no depend target */ |
| 241 | ;######################################################################## |
| 242 | ;# Dependencies generated by make depend |
| 243 | ;# DO NOT DELETE THIS LINE -- make depend relies on it |
| 244 | |
| 245 | ;# Put nothing here or make depend will gobble it up |
| 246 | .FORCE_DEPEND:: |
| 247 | ?TOP: @echo "You haven't run a 'make depend' yet!"; exit 1 |
| 248 | %TOP: @echo "You must run 'make depend' in $(TOP) first."; exit 1 |
| 249 | -skip /* Depend target */ |
| 250 | !NO!SUBS! |
| 251 | chmod 644 Makefile |
| 252 | $eunicefix Makefile |
| 253 | |