#include "../Calvin.tmpl"

TOP = ..

SRCS = motd_convert.c
OBJS = motd_convert.o

AllTarget(motd_convert)
NormalProgramTarget(motd_convert, $(OBJS),,,)
InstallProgram(motd_convert, $(NETREK_BIN)/motd)
DependTarget()

InstallScript(makemotd, $(NETREK_BIN)/motd)

#if BasePractice
InstallScript(topsbBP, $(NETREK_BIN)/motd)
#else
InstallScript(top50, $(NETREK_BIN)/motd)
InstallScript(topsb, $(NETREK_BIN)/motd)
#endif

#if BasePractice
makemotd.script: makemotdBP.script.tmpl
	sed "s|__BIN__|$(NETREK_BIN)|g" $? | sed "s|__PLAN__|$(PLANFILE)|g" > $@
#else
makemotd.script: makemotd.script.tmpl
	sed "s|__BIN__|$(NETREK_BIN)|g" $? | sed "s|__PLAN__|$(PLANFILE)|g" > $@
#endif

top50.script: top50.script.tmpl
	sed "s|__BIN__|$(NETREK_BIN)|g" $? | sed "s|__PLAN__|$(PLANFILE)|g" > $@
topsb.script: topsb.script.tmpl
	sed "s|__BIN__|$(NETREK_BIN)|g" $? | sed "s|__PLAN__|$(PLANFILE)|g" > $@
topsbBP.script: topsbBP.script.tmpl
	sed "s|__BIN__|$(NETREK_BIN)|g" $? | sed "s|__PLAN__|$(PLANFILE)|g" > $@
	

InstallNamedNonExecSafe(info.MASTER,info.MASTER,$(NETREK_BIN)/motd)
InstallNamedNonExecSafe(motd_local.MASTER,motd_local.MASTER,$(NETREK_BIN)/motd)
InstallNamedNonExecSafe(motd_logo.MASTER,motd_logo.MASTER,$(NETREK_BIN)/motd)

clean::
	$(RM) makemotd.script top50.script topsb.script topsbBP.script
