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

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


PUBLIB=/$objtype/lib/pub/$LIB
PUBINC=/sys/include/pub
MANDIR=/sys/man
AFLAGS=
CFLAGS=-I. -I$PUBINC

&:n:	&.$O
	ar vu $LIB$O $stem.$O

%.$O:	$HFILES			# don't combine with following %.$O rules

/sys/man/1pub/%:	%.1
	cp	$stem.1	/sys/man/1pub/$stem

/sys/man/3pub/%:	%.3
	cp	$stem.3	/sys/man/3pub/$stem

/sys/man/5pub/%:	%.5
	cp	$stem.5	/sys/man/5pub/$stem

/sys/man/6pub/%:	%.6
	cp	$stem.6	/sys/man/6pub/$stem

/sys/man/8pub/%:	%.8
	cp	$stem.8	/sys/man/8pub/$stem

$PUBINC/%.h:	%.h
	cp	$stem.h	$PUBINC

%.$O:	%.c
	$CC $CFLAGS $stem.c

%.$O:	%.s
	$AS $AFLAGS $stem.s

$O.%:	%.$O
	$LD	-o $O.$stem $stem.$O $LIB$O

all:V:	$LIB$O

$LIB$O:V:	$OFILES			# force archive even when not needed
	ar vu $LIB$O $newprereq

install:V:	$PUBLIB

installcmd:V: $PROGS
	for (x in $TARG) cp $O.$x /$objtype/bin/pub/$x

$PUBLIB:	$LIB$O
	cp $LIB$O $PUBLIB

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

%.all:V:
	for(objtype in $CPUS) mk $stem

%.installall:V:
	for(objtype in $CPUS) mk $stem

clean:V:
	rm -f *.[$OS] *.a[$OS] [$OS].out $CLEANFILES

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

nuke:V:	clean
	rm -f $NUKEFILES

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

update:V:
	update $UPDATEFLAGS $UPDATE

listing:V:
	pr mkfile ${OFILES:%.c=%.$O} | lp -du

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.