# $Id: DMakefile,v 1.10 1997/11/09 23:52:45 lars Exp $
#--------------------------------------------------------------------------
# Makefile for MkDepend
#
# Written for use with DICE 3 and its DMake 2.4
#--------------------------------------------------------------------------
# Available targets:
#  MkDepend: creates the program.
#  clean   : deletes all objects, test.#? and a.out.
#  clobber : same as clean, also deletes the executable.
#  depend  : updates the Makefile by the source dependencies.
#  archive : creates an archive MkDepend-<version>.lha
#--------------------------------------------------------------------------
# $Log: DMakefile,v $
# Revision 1.10  1997/11/09  23:52:45  lars
# RELEASE 1.4
#
# Revision 1.9	1997/11/08  19:00:08  lars
# Updated to archive GNUMakefile as well.
#
# Revision 1.8	1996/03/02  21:29:28  lars
# *** empty log message ***
#
# Revision 1.7	1996/03/02  21:22:28  lars
# More RCS tweaks to 'archive'.
#
# Revision 1.6	1996/03/02  21:18:11  lars
# RCS tweaks to target archive.
#
# Revision 1.5	1996/03/02  21:04:24  lars
# *** empty log message ***
#
# Revision 1.4	1996/03/02  20:46:56  lars
# New Release.
#
# Revision 1.3	1996/02/25  20:53:35  lars
# Put under RCS.
#
#--------------------------------------------------------------------------

# Release version, should match the version number in main.c and Makefile.
VERSION= 1.4

#--------------------------------------------------------------------------
# Source files
SOURCES= args.c main.c reader.c nodes.c

# Other files to archive
OTHER= $(SOURCES:*.c:%1.h) Makefile DMakefile GNUMakefile \
       HISTORY MkDepend.doc MkDepend.readme

# Object files to generate
OBJECTS= $(SOURCES:*.c:obj/%1.o)

# Check prototypes on compilation
CFLAGS= -O "" -proto

#--------------------------------------------------------------------------

MkDepend : obj $(OBJECTS)
	dcc -o %(left) %(right:*.o)

$(OBJECTS) : $(SOURCES)
	dcc $(CFLAGS) -o %(left) -c %(right)

clean :
	rcsclean
	delete #?.o test.#? a.out
	delete obj/#?

clobber : clean
	delete MkDepend MkDepend-#?.readme MkDepend-#?.lha
	delete obj all

depend : $(SOURCES)
	MkDepend $(SOURCES) -p.c:obj/%n.o -fDMakefile

archive : $(SOURCES) $(OTHER) depend MkDepend
	delete DMakefile force
	makedir MkDepend-$(VERSION)
	copy MkDepend $(SOURCES) $(OTHER) MkDepend-$(VERSION) clone
	copy MkDepend.readme MkDepend-$(VERSION).readme
	protect MkDepend-$(VERSION) +wd all
	protect MkDepend-$(VERSION).readme +wd
	delete MkDepend-$(VERSION).lha
	lha -axmr a MkDepend-$(VERSION).lha MkDepend-$(VERSION)
	delete MkDepend-$(VERSION) all quiet
	echo "Archive created."

obj :
	makedir obj

$(SOURCES) : $(SOURCES:*:RCS/%1,v)
	co %left

$(OTHER) : $(OTHER:*:RCS/%1,v)
	co %left

# --- DO NOT MODIFY THIS LINE -- AUTO-DEPENDS FOLLOW ---
obj/main.o :  main.c args.h main.h nodes.h reader.h

obj/args.o :  args.c args.h main.h

obj/nodes.o :  nodes.c nodes.h

obj/reader.o :	reader.c reader.h

# --- DO NOT MODIFY THIS LINE -- AUTO-DEPENDS PRECEDE ---
