# basescripts.mk
#
# copy those scripts required by vmake

TOOL=@tool@
MACH=@sapdb_mach@
OS=@sapdb_os@
OSSPEC=@sapdb_osspec@

MFCONCOM=$(TOOL)/pgm/mfconcom -n -RELVER=RTOOL
MFCONCOMFLAGS=$(MACH) FAST N PTOC $(OS) $(OSSPEC)

SRC=@buildroot@/sys/src

TMLSCRIPTS=toolvars mfextra
PLSCRIPTS=imf.pl mfcexp.pl mfrc.pl mfc.pl compc.pl mfcinc.pl mf_opts.pl
PMSCRIPTS=imake.pm ToolLib.pm ICopy.pm CCVers.pm GetInstDir.pm
LCSCRIPTS=lcmake.pm
PERLLIB=Mail/Sendmail.pm

all:

install: basescripts

basescripts:
	@for source in $(TMLSCRIPTS); \
	do echo mfconcom $$source.pl; \
		$(MFCONCOM) $(SRC)/tt/$$source-tml.pl.tt $(TOOL)/bin/$$source.pl $(MFCONCOMFLAGS); \
	done
	@for source in $(PLSCRIPTS) $(PMSCRIPTS); \
	do echo mfconcom $$source; \
		$(MFCONCOM) $(SRC)/tt/$$source.tt $(TOOL)/bin/$$source $(MFCONCOMFLAGS); \
	done
	@for source in $(LCSCRIPTS); \
	do echo mfconcom $$source; \
		$(MFCONCOM) $(SRC)/APODev/$$source $(TOOL)/bin/$$source $(MFCONCOMFLAGS); \
	done
	@for source in $(PERLLIB); \
	do echo cp $$source; \
		cp $(SRC)/Perl/$$source $(TOOL)/lib/perl5/$$source; \
	done

