#
#	Teleport-Vehicle/0.0
#			June 1995, <ysato@etl.go.jp>
#

LIBFILE =	libteleport.a
TELEPORT =	teleport.exe

TARGET =	all
target:		$(TARGET)
libx:		Makefile.go
		$(MAKE) -f Makefile.go $(LIBFILE) SHELL="$(SHELL)" HDRDIR="$(HDRDIR)"
MKMAKE =	exit 1
Makefile.go:	Makefile
		$(MKMAKE) -mkmake "$(MAKE)" $@ "$(CFLAGS)" "$(LDFLAGS)" "$(RANLIB)" "$(NETLIB)" NETLIB

$(TELEPORT):	Makefile.go
		$(MAKE) -f Makefile.go teleportc \
			HDRDIR="$(HDRDIR)" LIBDIR="$(LIBDIR)" LDLIBS="$(LDLIBS)"

CFLAGS =	-O
HDRDIR =	-I../include

#ifdef MSWIN ######################################################
CCOUT =		-Fo$*.o
LDOUT =		-Foteleport.exe
ARC =		lib.exe /out:$@
RANLIB =	echo
#endif #############
#ifdef UNIX,OS2EMX ################################################
CCOUT =		
LDOUT =		-o teleport.exe
ARC =		ar cr $@
#RANLIB =	ranlib
RANLIB =	ar ts
#endif #############

FILES =		README Makefile teleportd.c teleport.c \
		vehicle.c qzcode.c qz.c

.c.o:
		$(CC) $(CFLAGS) $(HDRDIR) -c $*.c $(CCOUT)

LIBOBJS =	teleport.o teleportd.o vehicle.o qzcode.o

#---BGN---
#---END---

all:

$(LIBFILE):	Makefile $(LIBOBJS)
		-$(RM) $@
		$(ARC) $(LIBOBJS)
		-$(RANLIB) $@

makeit:		teleport qz

teleportc:	Makefile teleport.o
		$(CC) $(CFLAGS) $(LDOUT) teleport.o \
		../src/_builtin.o ../lib/libdelegate.a $(LIBDIR) $(LDLIBS) \
		../lib/libsubst.a

qz:		qz.o qzcode.o 
		$(CC) $(CFLAGS) -o qz qz.o qzcode.o

files:;         ls -d $(FILES)
srcfiles:;	@echo $(FILES)
