#
# Makefile  -  makefile for utility programs
#
# Copyright (C) 1995,1996 Gero Kuhlmann <gero@gkminix.han.de>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#


#
#  Include system dependent definitions:
#
include ../../config.mk


#
#  List of source and object files:
#
CSRCS	= pass1.c pass2.c config.c
ASRCS	= 
OBJS	= pass1.obj pass2.obj config.obj
TARGET	= pass1.exe pass2.exe config.exe


#
#  Rules to create object files from source files:
#
.SUFFIXES:	.c .asm .obj .exe .lib

.c.obj: 
ifdef VERBOSE
	$(CC) -y -c $(CFLAGS) $(UTLCFL) $<
else
	$(CC) -y -c $(CFLAGS) $(UTLCFL) $< >NUL
endif

.asm.obj:
	$(ASM) $(AFLAGS) $(UTLAFL) $< ;


#
#  Target rules.
#
all:		$(TARGET)

pass1.exe:	pass1.obj
	$(LNKP) $(LFLAGS) $(SYSOBJ) $?, $@, ,$(SYSLIB) ;
	@ren $@ a.out
	$(EXEPACK) a.out $@ >NUL
	@copy $@ .. >NUL
	@$(RM) a.out

pass2.exe:	pass2.obj
	$(LNKP) $(LFLAGS) $(SYSOBJ) $?, $@, ,$(SYSLIB) ;
	@ren $@ a.out
	$(EXEPACK) a.out $@ >NUL
	@copy $@ .. >NUL
	@$(RM) a.out

config.exe:	config.obj
	$(LNKP) $(LFLAGS) $(SYSOBJ) $?, $@, ,$(SYSLIB) ;
	@ren $@ a.out
	$(EXEPACK) a.out $@ >NUL
	@copy $@ .. >NUL
	@$(RM) a.out


#
#  Maintenance rules for cleaning up.
#
.PHONY:	clean

clean:
	@$(RM) a.out
	-$(RM) $(TARGET)
	-$(RM) *.obj
	-$(RM) *.lst
	-$(RM) *.map
	-$(RM) *.bak


dummy:

