#---------------------------------------------------------------------------
# Now some predefined settings for various compilers/systems. You might 
# find other combinations of CFLAGS more useful, so check above which 
# features you want.
#---------------------------------------------------------------------------
#
#
CC= gcc
LN= ln
CHMEM= :
OS_DEFS=`../.osdefs` 
DEF_DEFS=`../.gbldefs` 

SHLIBS= `../.shtest`
CFLAGS= -O2 -s -w $(DEF_DEFS)  \
	$(OS_DEFS) 
 LIB= #-L/usr/lib/termcap -ltermcap
 CONVERT= mv a.out $@
 CHOWN= chown $(OWNER)
 CHGRP= chgrp $(GROUP)
 STRIP= :
#---------------------------------------------------------------------------
#
#---------------------------------------------------------------------------



# This is the pager which BLED uses to display his helpfile

BLPAGER=/bin/cat


# In this directory, you hide your helpfiles and manuals

HELPDIR=/usr/doc


# Sorry, but SETUID root.root is still necessary!
# NOTE: On certain systems this might be root.other instead! Just log
#       in as root and type "id". That'll make it quite clear. 

OWNER=root
GROUP=root
#GROUP=other	# SCO shall use this but can use the default as well!


#---------------------------------------------------------------------------
# That's about it. There's nothing left to define ... leave now and try to
# get the whole thing compiled. Type: 'make inst' 
#---------------------------------------------------------------------------





BLED.GER.OBJ=bltools.o bled.deutsch.o  blgetline.o derror.o
BLED.ENG.OBJ=bltools.o bled.english.o  blgetline.o derror.o
BLED.FRA.OBJ=bltools.o bled.francais.o blgetline.o derror.o

#bltools.o
BLED.OBJ= bled.o blgetline.o ../mbox.tools.o ../uqwk/language.o ../derror.o 

PROGS=mbox bled mb-daemon mbrsh xmd

PID= `echo $$`

default:; @echo 'invalid option, make the binaries in the main-src-path'

all:	$(PROGS)
	@echo ''
	@echo '- All files have been made.'
	@echo ''


bled.deutsch:	$(BLED.GER.OBJ)
	@echo ''
	@echo '- The Editor german BLed is going to be compiled...'
	@echo ''
	$(CC) $(CFLAGS) ../getch.o $(BLED.GER.OBJ) $(LIB)
	@$(CONVERT)
	@$(STRIP)
	@chmod +x bled.deutsch


bled.english:	$(BLED.ENG.OBJ)
	@echo ''
	@echo '- The Editor english BLed is going to be compiled...'
	@echo ''
	$(CC) $(CFLAGS) ../getch.o $(BLED.ENG.OBJ) $(LIB)
	@$(CONVERT)
	@$(STRIP)
	@chmod +x bled.english



bled.francais:	$(BLED.FRA.OBJ)
	@echo ''
	@echo '- The Editor francais BLed is going to be compiled...'
	@echo ''
	$(CC) $(CFLAGS) ../getch.o  $(BLED.ENG.OBJ) $(LIB)
	@$(CONVERT)
	@$(STRIP)
	@chmod +x bled.francais



bled:	$(BLED.OBJ)
	@echo ''
	@echo '- The Editor BLed (use msg-base) is going to be compiled...'
	@echo ''
	$(CC) $(CFLAGS) ../getch.o $(BLED.OBJ) $(LIB) $(SHLIB)
	@$(CONVERT)
	@$(STRIP)
	@chmod +x bled



clean:;
	@echo ''
	@rm -f *.o bled.deutsch bled.english bled.francais
	@echo ''

blgetline.o:	 
	@if test -f blgetline.c ; then echo -n '' ; \
		else cp getline.c blgetline.c ; fi
	$(CC) -c $(CFLAGS) blgetline.c


#bled.o:	 patchlevel.h
#	$(CC) -c $(CFLAGS) -DHILFE="\"$(BLPAGER) $(HELPDIR)/bled.doc"\" bled.c


