#Buildfile for define, undefine, and context (a.k.a. pwd)
#Rob Nagler and Tim Mann

SOURCES = define.c undefine.c context.c
HEADERS =
OBJECTS = define.b undefine.b context.b
ALL = define undefine context pwd
INCLUDES = 
LIBRARIES = 
.SUFFIXES: .b .ls .s .c

#ifdef X
C68FLAGS = -V -vx -O
#else X
C68FLAGS = -V -O
#endif X


# normal compile of a module
.c.b:
	cc68 $(C68FLAGS) $(INCLUDES) -c $*.c 

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

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

all: $(ALL)

undefine: undefine.b
	cc68 -r $(C68FLAGS) -o undefine undefine.b $(LIBRARIES)

define: define.b
	cc68 -r $(C68FLAGS) -o define define.b $(LIBRARIES)

context: context.b
	cc68 -r $(C68FLAGS) -o context context.b $(LIBRARIES)

pwd: context
	cp context pwd

clean:
	rm -f *.BAK *.CKP $(OBJECTS)

install:
#ifdef X
	netinstall -x -p "$(ALL)" /usr/sun/xVboot
#else X
	netinstall -p "$(ALL)" /usr/sun/Vboot
#endif X

xbuild:
	buildmake.sh -DX=1

build:
	buildmake.sh

tags: $(HEADERS) $(SOURCES)
	ctags $(HEADERS) $(SOURCES)
