Plan 9 from Bell Labs’s /usr/web/sources/contrib/lucio/pub/mkfile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


</$objtype/mkfile

LDFLAGS=
YFLAGS=-d

BIN=/$objtype/bin/pub

TARG=`{ls *.[cy] | sed '/\.tab\.c$/d;s/..$//'}
PROGS=${TARG:%=$O.%}

OBSOLETE=libgeotiff-1.2.2|proj-4.4.9|tiff-3.8.2|zlib-1.2.3
IGNORE=compat|gd|graphviz|jpeg-6b|jpeg|libgeotiff-1.2.2|libgeotiff-1.2.3|libpng-1.2.9|links|png|proj-4.4.9|tcl7.6|tea|tiff-3.7.3|tiff-3.8.2|tiff-v3.5.5|tiff-v3.6.1|zlib-1.2.3

cpuobjtype=`{sed -n 's/^O=//p' /$cputype/mkfile}
DIRS=`{ls -l | sed '/^d/!d; s/.* //; /^('$IGNORE')$/d'}

HFILES=

none:VQ:
	echo usage: mk cmds, dirs, all, install, installall, '$O'.cmd, cmd.install, or cmd.installall

cmds:V:	$PROGS

dirs:V:
	for(i in $DIRS) @{
		cd $i
		echo mk $i
		mk $MKFLAGS all
	}

all:V:	$PROGS dirs

^([$OS])\.(.*):R:	\2.\1
	$stem1^l $LDFLAGS -o $target $stem2.$stem1

.*\.[$OS]:R:	$HFILES

(.*)\.([$OS])'$':R:	\1.c
	$stem2^c -p -D_PLAN_9 -I/sys/include/ape -I/$objtype/include/ape $CFLAGS  $stem1.c

&:n:	$O.&
	mv $O.$stem $stem

%.tab.h %.tab.c:	%.y
	$YACC $YFLAGS -s $stem $prereq

%.install:V: $BIN/%

%.safeinstall:	$O.%
	test -e $BIN/$stem && mv $BIN/$stem $BIN/_$stem
	cp $O.$stem $BIN/$stem

%.safeinstallall:
	for(objtype in $CPUS)
		mk $stem.safeinstall
	mk $stem.clean

$BIN/%:	$O.%
	cp $O.$stem $BIN/$stem

%.directories:V:
	for(i in $DIRS) @{
		cd $i
		echo mk $i
		mk $MKFLAGS $stem
	}

clean:V:	cleanfiles clean.directories

nuke:V:		cleanfiles nuke.directories

directories:V:	install.directories

cleanfiles:V:
	rm -f [$OS].out *.[$OS] y.tab.? y.debug y.output [$OS].$TARG [$OS].units.tab $TARG bc.c bc.tab.h units.tab.h units.c [$OS]._cp

%.clean:V:
	rm -f [$OS].$stem $stem.[$OS]

install:V:
	mk $MKFLAGS $TARG.install
	mk $MKFLAGS directories

installall:V:
	for(objtype in $CPUS)
		mk $MKFLAGS install

%.installall:	%.c
	for (objtype in $CPUS) {
		rfork e
		mk $stem.install &
	}
	wait
	rm -f $stem.[$OS] y.tab.? $stem.tab.? y.debug y.output [$OS].$stem bc.c bc.tab.h units.c

%.acid: %.$O $HFILES
	$CC $CFLAGS -a $stem.c >$target

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].