shithub: riscv

ref: 4dbb99f478d68eaeea4c043a839454cb807c2c7d
dir: /sys/src/cmd/ndb/mkfile/

View raw version
# cs & dns mkfile
</$objtype/mkfile

TARG =	\
	mkdb\
	query\
	mkhash\
	mkhosts\
	cs\
	csquery\
	dns\
	dnsquery\
	dnsdebug\
	dnsgetip\
	ipquery\
	inform\

DNSOBJ = dns.$O dnudpserver.$O dntcpserver.$O dn.$O dnresolve.$O dblookup.$O dnserver.$O dnnotify.$O\
	 dnarea.$O convM2DNS.$O convDNS2M.$O

DNSDEBUGOBJ = dnsdebug.$O dn.$O dnresolve.$O dblookup.$O dnserver.$O\
	 dnarea.$O convM2DNS.$O convDNS2M.$O

DNSGETIPOBJ = dnsgetip.$O dn.$O dnresolve.$O dblookup.$O dnserver.$O\
	 dnarea.$O convM2DNS.$O convDNS2M.$O

HFILES = dns.h /$objtype/lib/libndb.a

BIN=/$objtype/bin/ndb

</sys/src/cmd/mkmany

$O.dns: $DNSOBJ
	$LD -o $target $prereq

$O.dnsdebug: $DNSDEBUGOBJ
	$LD -o $target $prereq

$O.dnsgetip: $DNSGETIPOBJ
	$LD -o $target $prereq

$O.cs: cs.$O
	$LD -o $target $prereq

cs.safeinstall:V: $O.cs
	if(test -e $BIN/ooocs)
		mv $BIN/ooocs $BIN/oooocs
	if(test -e $BIN/oocs)
		mv $BIN/oocs $BIN/ooocs
	if(test -e $BIN/ocs)
		mv $BIN/ocs $BIN/oocs
	mv $BIN/cs $BIN/ocs
	cp $O.cs $BIN/cs

dns.safeinstall:V: $O.dns
	if(test -e $BIN/ooodns)
		mv $BIN/ooodns $BIN/oooodns
	if(test -e $BIN/oodns)
		mv $BIN/oodns $BIN/ooodns
	if(test -e $BIN/odns)
		mv $BIN/odns $BIN/oodns
	mv $BIN/dns $BIN/odns
	cp $O.dns $BIN/dns

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

dns.update:V:
	SRC=`{echo $DNSOBJ|sed 's/\.'$O'/.c/g'}
	update $UPDATEFLAGS dns.h $SRC

%.update:V:
	update $UPDATEFLAGS $stem.c

update:V:
	mk clean
	T=`{echo $TARG|sed 's/( |$)/.update /g'}
	mk 'UPDATEFLAGS='$"UPDATEFLAGS $T
	update $UPDATEFLAGS mkfile