###############################################################################
#
#    Makefile directory tools
#    Copyright (C) 1993 A. Bode, S. Lamberts, T. Ludwig, G. Stellner
#
#    This file is part of NXLIB (Paragon(TM) message passing on workstations)
#
#    NXLIB is free software; you can redistribute it and/or
#    modify it under the terms of the GNU Library General Public
#    License as published by the Free Software Foundation; either
#    version 2 of the License, or (at your option) any later version.
#
#    NXLIB 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
#    Library General Public License for more details.
#
#    You should have received a copy of the GNU Library General Public
#    License along with this library; if not, write to the Free
#    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    Contact to the authors:
#
#    electronic mail: nxlib@informatik.tu-muenchen.de
#
#    paper mail:      Prof. Dr. A. Bode
#                     Lehrstuhl f"ur Rechnertechnik und Rechnerorganisation
#                     Institut f"ur Informatik
#                     Technische Universit"at M"unchen
#                     80290 M"unchen
#                     Germany
#
#    Paragon(TM) is a trademark of Intel Corporation.
#
###############################################################################
#
# Makefile,v
# 1995/02/10 14:41:07
# 1.8
# Exp
# lamberts
#
# Authors: Stefan Lamberts
#
# Description: Makefile directory tools
#
###############################################################################
#
# rcs_id: "Makefile,v 1.8 1995/02/10 14:41:07 lamberts Exp"
#

# Enable this macro for C++ support
# CPLUSPLUS = YES

RM = rm -f

# The shell which is used by the makefile
SHELL = /bin/sh

CC = "cc"
FC = "f77"
CXX = "CC +a1"
FLIBDIR = "/usr/lang/SC0.0"
NXLIBDIR = "."
DEBUGGER = "xdbx"
NXLDLIBS = 
NXFFLAGS =
NXFLDLIBS = -Bstatic -L/usr/lang/SC0.0 -lnx -ll -Bdynamic
FMAIN_TMPL = main
MAIN_TMPL = main_
MKNOD_TMPL = /etx/mknod
SIGINT_TMPL = 2

all: vpcc vpCC_$(CPLUSPLUS) vpf77 ddbg adbg nxlstdin

# .DEFAULT will be executed if C++ is not enabled.
# This is valid for any target which is not explicitly specified
# this includes vpCC_* where * is != YES
.DEFAULT:
	@echo -n

vpcc:	vpcc.tmpl
	sed	-e "s%CC_TMPL%$(CC)%g"\
		-e "s%NXLIBDIR_TMPL%$(NXLIBDIR)%g" \
		-e "s%MAIN_TMPL%$(MAIN_TMPL)%g" \
		-e "s%NXLDLIBS_TMPL%$(NXLDLIBS)%g" \
		vpcc.tmpl > $@
	chmod 755 $@

vpCC_YES: vpCC

vpCC:	vpCC.tmpl
	sed	-e "s%CC_TMPL%$(CXX)%g"\
		-e "s%NXLIBDIR_TMPL%$(NXLIBDIR)%g" \
		-e "s%MAIN_TMPL%$(MAIN_TMPL)%g" \
		-e "s%NXLDLIBS_TMPL%$(NXLDLIBS)%g" \
		vpCC.tmpl > $@
	chmod 755 $@

vpf77:	vpf77.tmpl
	sed	-e "s%F77_TMPL%$(FC)%g"\
		-e "s%CC_TMPL%$(CC)%g"\
		-e "s%NXFFLAGS_TMPL%$(NXFFLAGS)%g"\
		-e "s%NXFLDLIBS_TMPL%$(NXFLDLIBS)%g"\
		-e "s%NXFLIBS_CG87_TMPL%$(NXFLIBS_CG87)%g"\
		-e "s%NXFLIBS_CG89_TMPL%$(NXFLIBS_CG89)%g"\
		-e "s%NXFLIBS_CG92_TMPL%$(NXFLIBS_CG92)%g"\
		-e "s%NXLDLIBS_TMPL%$(NXLDLIBS)%g"\
		-e "s%NXLIBDIR_TMPL%$(NXLIBDIR)%g" \
		-e "s%FMAIN_TMPL%$(FMAIN_TMPL)%g" \
		vpf77.tmpl > $@
	chmod 755 $@

ddbg:	ddbg.tmpl
	sed	-e "s%DEBUGGER%$(DEBUGGER)%g" ddbg.tmpl > $@
	chmod 755 $@

adbg:	adbg.tmpl
	sed	-e "s%DEBUGGER%$(DEBUGGER)%g" adbg.tmpl > $@
	chmod 755 $@

nxlstdin:	nxlstdin.tmpl
	sed	-e "s%MKNOD_TMPL%$(MKNOD_TMPL)%g"\
		-e "s%SIGINT_TMPL%$(SIGINT_TMPL)%g" \
		nxlstdin.tmpl > $@
	chmod 755 $@


clean:
	$(RM) vpcc vpf77 ddbg adbg vpCC nxlstdin


realclean: clean
	$(RM) *~
