# this makefile runs using the public domain make utility `ndmake' by
# Don Kneller. 
#
#
CFLAGS = -AS -Ox
MAPFIL =  nul
SRCS =  indent.c io.c lexi.c parse.c pr_comme.c args.c doindent.c dopreesc.c
OBJS =  indent.obj io.obj lexi.obj parse.obj pr_comme.obj args.obj \
        doindent.obj dopreesc.obj

indent.exe : ${OBJS}
                cl ${OBJS}

# make depend can alse make these lines [maybe. . . (it is magic to me)]
indent.obj: indent.c indent_g.h indent_c.h
io.obj: io.c indent_g.h
lexi.obj: lexi.c indent_g.h indent_c.h
parse.obj: parse.c indent_g.h indent_c.h
pr_comme.obj: pr_comme.c indent_g.h
args.obj: args.c indent_g.h
doindent.obj: doindent.c indent_g.h indent_c.h

clean :
               rm  ${OBJS} indent.exe

.IGNORE: foo
pack :
                if exist foo del foo
                exepack indent.exe foo
                del indent.exe
                ren foo indent.exe

install : indent.exe
                copy indent.exe \bin

arc : ${OBJS} indent.exe
        if exist indent.arc del indent.arc
        arca indent.arc *.c *.h readme indent.man indent.exe \
                        \indent.pro makefile

# there is a PC `bawk' that might do this. . .
depend :
                ${CC} -M ${SRCS} | \
                    awk '{ if ($$1 != prev) { if (rec != "") print rec; \
                rec = $$0; prev = $$1; } \
                else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
                else rec = rec " " $$2 } } \
                END { print rec }' >makedep
        echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
        echo '$$r makedep' >> eddep
        echo 'w' >>eddep
        cp Makefile Makefile.bak
        ed - Makefile < eddep
        rm eddep makedep
        echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
        echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
        echo '# see make depend above' >> Makefile

# DO NOT DELETE THIS LINE -- make depend uses it

# DEPENDENCIES MUST END AT END OF FILE 
# IF YOU PUT STUFF HERE IT WILL GO AWAY 
# see make depend above 

