#### Start of system configuration section. ####

srcdir =	@srcdir@
VPATH =		@srcdir@

# Common prefix for machine-independent installed files.
prefix =	@prefix@

# Common prefix for machine-dependent installed files.
exec_prefix =	@exec_prefix@

bindir =	$(exec_prefix)/bin
libdir =	$(exec_prefix)/Sys/libs

INSTALL =	@INSTALL@
INSTALL_DATA =	@INSTALL_DATA@

CC =		@CC@

CFLAGS =	@CFLAGS@
LDFLAGS =	@LDFLAGS@

RANLIB =	@RANLIB@
AR =		ar

#### End system configuration section ####

FLAVOR_CFLAGS =	-m$(CPU) -m$(FPU)
OTHER_CFLAGS =	-fomit-frame-pointer
ALL_CFLAGS =	$(CFLAGS) $(FLAVOR_CFLAGS) $(OTHER_CFLAGS) $(INCS)

INCS =		-I$(srcdir) -I$(srcdir)/../library -I$(srcdir)/../include
LIB =		libgen.a

.s.o:
		cp $< x.c
		$(CC) $(ALL_CFLAGS) -traditional -E x.c -o x.s
		$(CC) $(ALL_CFLAGS) -c x.s -o $@
		rm -f x.c x.s

.c.o:
		$(CC) $(ALL_CFLAGS) -c $< -o $@

SRC =		_setjmp.s alarm.c clock.c crypt.c ctype_.c difftime.c \
		errlst.c fnmatch.c fts.c getlogin.c getmntinfo.c getwd.c \
		glob.c insque.s isctype.c isinf.c isnan.c mktemp.c pause.c \
		psignal.c random.c remove.c remque.s setjmp.s setjmperr.c \
		siginterrupt.c siglist.c signal.c sigsetjmp.c sigsetops.c \
		sleep.c termios.c time.c times.c ualarm.c unvis.c usleep.c \
		vis.c wait.c wait3.c waitpid.c
#raise.c not used

OBJ =		_setjmp.o alarm.o clock.o crypt.o ctype_.o difftime.o \
		errlst.o fnmatch.o fts.o getlogin.o getmntinfo.o getwd.o \
		glob.o insque.o isctype.o isinf.o isnan.o mktemp.o pause.o \
		psignal.o random.o remove.o remque.o setjmp.o setjmperr.o \
		siginterrupt.o siglist.o signal.o sigsetjmp.o sigsetops.o \
		sleep.o termios.o time.o times.o ualarm.o unvis.o usleep.o \
		vis.o wait.o wait3.o waitpid.o
#raise.o not used


$(LIB):		$(OBJ)
		rm -f $@
		$(AR) rv $@ $(OBJ)
		$(RANLIB) $@

clean:
		rm -f *!

clobber:	clean
		rm -f $(OBJ) $(LIB)

glob.o:		$(srcdir)/glob.c
		$(CC) $(ALL_CFLAGS) -ffixed-a4 -c $(srcdir)/glob.c -o $@
