CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)

OBJS=   os.o os-inline.o bs2login.o

LIB=	libos.a

all:	$(LIB)

$(LIB): $(OBJS)
	rm -f $@
	ar cr $@ $(OBJS)
	$(RANLIB) $@

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $<

clean:
	rm -f $(OBJS) $(LIB)

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

$(OBJS): Makefile

# DO NOT REMOVE
bs2login.o: bs2login.c
bs2login.o: $(INCDIR)/httpd.h
bs2login.o: $(INCDIR)/ap_config.h
bs2login.o: $(INCDIR)/ap_mmn.h
bs2login.o: $(INCDIR)/ap_config_auto.h
bs2login.o: os.h
bs2login.o: $(INCDIR)/ap_ctype.h
bs2login.o: $(INCDIR)/hsregex.h
bs2login.o: $(INCDIR)/ap_alloc.h
bs2login.o: $(INCDIR)/buff.h
bs2login.o: $(INCDIR)/ap.h
bs2login.o: ebcdic.h
bs2login.o: $(INCDIR)/util_uri.h
bs2login.o: $(INCDIR)/http_config.h
bs2login.o: $(INCDIR)/http_log.h
ebcdic.o: ebcdic.c
ebcdic.o: $(INCDIR)/ap_config.h
ebcdic.o: $(INCDIR)/ap_mmn.h
ebcdic.o: $(INCDIR)/ap_config_auto.h
ebcdic.o: os.h
ebcdic.o: $(INCDIR)/ap_ctype.h
ebcdic.o: $(INCDIR)/hsregex.h
ebcdic.o: ebcdic.h
os-inline.o: os-inline.c
os-inline.o: $(INCDIR)/ap_config.h
os-inline.o: $(INCDIR)/ap_mmn.h
os-inline.o: $(INCDIR)/ap_config_auto.h
os-inline.o: os.h
os-inline.o: $(INCDIR)/ap_ctype.h
os-inline.o: $(INCDIR)/hsregex.h
os.o: os.c
os.o: $(INCDIR)/httpd.h
os.o: $(INCDIR)/ap_config.h
os.o: $(INCDIR)/ap_mmn.h
os.o: $(INCDIR)/ap_config_auto.h
os.o: os.h
os.o: $(INCDIR)/ap_ctype.h
os.o: $(INCDIR)/hsregex.h
os.o: $(INCDIR)/ap_alloc.h
os.o: $(INCDIR)/buff.h
os.o: $(INCDIR)/ap.h
os.o: ebcdic.h
os.o: $(INCDIR)/util_uri.h
os.o: $(INCDIR)/http_core.h