##
##  Apache Makefile, automatically generated by Configure script.
##  Hand-edited changes will be lost if the Configure script is re-run.
##  Sources: - ../Makefile.config (via Configuration.apaci)
##           - ./Makefile.tmpl
##

##
##  Inherited Makefile options from Configure script
##  (Begin of automatically generated section)
##
SRCDIR=..
MWOS=/mwos
EXTRA_CFLAGS=`$(SRCDIR)/apaci`
EXTRA_LDFLAGS=
EXTRA_LIBS=
EXTRA_INCLUDES=
EXTRA_DEPS=
OSDIR=$(SRCDIR)/os/os9
INCDIR=$(SRCDIR)/include
INCLUDES0=-v$(OSDIR) -v$(INCDIR)
SHELL=/bin/sh
OS=OS9
CC=xcc
TARGET=httpd
OPTIM=
CFLAGS1= -DOS9 -v$(SRCDIR)/lib/expat-lite
INCLUDES1= -v$(MWOS)/src/defs/spf/bsd
LIBS_SHLIB=
LDFLAGS1=
REGLIB=regex/libregex.l
EXPATLIB=lib/expat-lite/libexpat.l
RANLIB=merge
LIBS1=
##
##  (End of automatically generated section)
##


CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=-llibap.l -llibos.l $(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) -L$(OSDIR) -L$(SRCDIR)/ap

TARGETS=htpasswd htdigest rotatelogs logresolve ab apxs

OBJS=htpasswd.r htdigest.r rotatelogs.r logresolve.r ab.r

.c.r: 
	$(CC) -eas $(INCLUDES) $(CFLAGS) $<

all: $(TARGETS)

htpasswd: htpasswd.r
	$(CC) $(CFLAGS) -fd=htpasswd $(LDFLAGS) htpasswd.r $(LIBS)

htdigest: htdigest.r
	$(CC) $(CFLAGS) -fd=htdigest $(LDFLAGS) htdigest.r $(LIBS)

rotatelogs: rotatelogs.r
	$(CC) $(CFLAGS) -fd=rotatelogs $(LDFLAGS) rotatelogs.r $(LIBS)

logresolve: logresolve.r
	$(CC) $(CFLAGS) -fd=logresolve $(LDFLAGS) logresolve.r $(LIBS)

ab: ab.r
	$(CC) $(CFLAGS) -fd=ab $(LDFLAGS) ab.r $(LIBS)

apxs: apxs.pl
	sed <apxs.pl >apxs \
	    -e 's%@TARGET@%$(TARGET)%g' \
	    -e 's%@CC@%$(CC)%g' \
	    -e 's%@CFLAGS@%$(CFLAGS)%g' \
	    -e 's%@CFLAGS_SHLIB@%$(CFLAGS_SHLIB)%g' \
	    -e 's%@LD_SHLIB@%$(LD_SHLIB)%g' \
	    -e 's%@LDFLAGS_MOD_SHLIB@%$(LDFLAGS_MOD_SHLIB)%g' \
	    -e 's%@LIBS_SHLIB@%$(LIBS_SHLIB)%g' && chmod a+x apxs

suexec: suexec.r
	$(CC) $(CFLAGS) -fd=suexec $(LDFLAGS) suexec.r $(LIBS)

clean:
	rm -f $(TARGETS) *.r

distclean: clean
	-rm -f Makefile

# We really don't expect end users to use this rule.  It works only with
# gcc, and rebuilds Makefile.tmpl.  You have to re-run Configure after
# using it.
depend:
	cp Makefile.tmpl Makefile.tmpl.bak \
	    && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
	    && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \
	    && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \
	           -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \
		> Makefile.tmpl \
	    && rm Makefile.new

#Dependencies

$(OBJS): Makefile

# DO NOT REMOVE
ab.r: ab.c $(INCDIR)/ap_config.h $(INCDIR)/ap_config_auto.h \
 $(OSDIR)/os.h $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h
htdigest.r: htdigest.c $(INCDIR)/ap_config.h \
 $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
 $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h
htpasswd.r: htpasswd.c $(INCDIR)/ap_config.h \
 $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
 $(INCDIR)/hsregex.h
logresolve.r: logresolve.c $(INCDIR)/ap_config.h \
 $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
 $(INCDIR)/hsregex.h
rotatelogs.r: rotatelogs.c $(INCDIR)/ap_config.h \
 $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
 $(INCDIR)/hsregex.h
suexec.r: suexec.c $(INCDIR)/ap_config.h $(INCDIR)/ap_config_auto.h \
 $(OSDIR)/os.h $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h suexec.h
