# Makefile for LHArc UNIX
#	Copyright(C) MCMLXXXIX  Yooichi.Tagawa
# V0.01  Alpha Version				1989.05.28  Y.Tagawa
# V0.02  Alpha Version R2			1989.05.29  Y.Tagawa
# V0.03  Release #3  Beta Version		1989.07.02  Y.Tagawa

#-----------------------------------------------------------------------
# DIRECTORY ACCESS DEPENDENDS...
#  The default (no need swtich) is your machine has
#  opendir(),readdir(),closedir() library and 'direct' structure used.
#  If your machine has no opendir (), readdir (), closedir ()
#	-DNONSYSTEM_DIR_LIBRARY
#  and add lhdir.o into OBJS macro (see bellow)
#  If your machine are 'dirent' (not 'direct') structure used,
#	-DSYSV_SYSTEM_DIR
#  Otherwise "Give up!"
#	-DNODIRECTORY
#
#-----------------------------------------------------------------------
# MEMORY ACCESS STUFF
#  Your machine has no BSTRING library (bcmp,bcopy,bzero).
#	-DNOBSTRING
#
#-----------------------------------------------------------------------
# TIME STUFF
#  Your include file '<sys/time.h>' has no 'struct tm',  define this.
#	-DSYSTIME_HAS_NO_TM
#
#  If your system libraries already have a strdup:
#	-DSVR4
#
#  If you do not want lharc to change the case of any filenames:
#  	-DPRESERVECASE

# most of 4.[23]BSD
#	- vax 4.[23]BSD, SONY NEWS 4.[23]BSD etc.
#SWITCHIES	= -DNOBSTRING -DNODIRECTORY
#OBJS		= lharc.o lzhuf.o lhio.o

# sample of System-V
#	- NEC EWS4800
SWITCHIES	= -DSYSV_SYSTEM_DIR -DNOBSTRING -DSYSTIME_HAS_NO_TM -DSVR4 -DPRESERVECASE
OBJS		= lharc.o lzhuf.o lhio.o

CC		= gcc
CFLAGS		= -O $(SWITCHIES)
LDFLAGS		= -s

#	Xlharc is test binary.  Please rename to lharc at install.
#	(see install target)
all:	xlharc

xlharc	: $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)

#	For Debugging LzHuff module.
lzhuf	: lzhuf.c
	$(CC) $(CFLAGS) -DSELFMAIN -o $* $*.c

lzhuf.o	lhio.o	: lhio.h

clean:
	rm -f core lharc.o lzhuf.o lhdir.o lhio.o lharc.tar lharc.tar.Z
