#
# Buildfile for V local name server
#

HOSTS=shasta navajo
INCLUDE= ../../libc/include
HEADERS= $(INCLUDE)/Venviron.h $(INCLUDE)/Vioprotocol.h $(INCLUDE)/Vnaming.h \
	localname.h $(INCLUDE)/Vdevicetypes.h
SOURCES= localname.c
OBJECTS= localname.b

#ifdef X
C68FLAGS= -I$(INCLUDE) -O -V -vx
#else X
C68FLAGS= -I$(INCLUDE) -O -V
#endif X

# first, define the world of 68000s
.SUFFIXES: .b .ls .a68 .c

# how to compile a 68000 file
.c.b:
	cc68 $(C68FLAGS) -c $*.c 

# how to make an assembly file (Not deleting it or assembling it)
.c.s:
	cc68 $(C68FLAGS) -S $*.c

# how to make an assembly listing
.c.ls:
	cc68 $(C68FLAGS) -c -L $*.c

# END world of 68000's

# compile everything that needs it
all: $(OBJECTS)
	rm -f libVlocname.a
	ar rv libVlocname.a $(OBJECTS)

install:
#ifdef X
	netinstall -x libVlocname.a /usr/sun/xlib
#else X
	netinstall libVlocname.a /usr/sun/lib $(HOSTS)
#endif X

$(OBJECTS): $(HEADERS)

clean:
	rm -f *.o *.b *.s *.ls *CKP *BAK .emacs* *.a

backup:
	cd ..; cpdir localname ../../Vbackup/servers/localname

build:
	buildmake.sh

xbuild:
	buildmake.sh -DX=1
