# Generated automatically from Makefile.in by configure.
#C-Compiler (gcc if exist):
CC=		gcc
CFLAGS=		-O2 -m486 -s

#Source Directory:
srcdir=		.

#Destination Directory
prefix=/usr
DESTDIR=	$(prefix)/bin
LIBDIR=		$(prefix)/lib
WPELIBDIR=	$(LIBDIR)/wpe
MANDIR=		$(prefix)/man

LIBS=-lX11  -lncurses
DEFS=-I/usr/include/ncurses -I/usr/include/X11  -DRANLIB -D"PRNTCMD=\"lpr\"" -DNOVSWTCH
EXTDEFS=
EXTLIBS=
INSTALL=	cp

#If You like or need uncomment the following Statements:

# Put in here special Flags if you like
# SPFLAGS=	-DALTMASK=Mod3Mask -DDEF_SHELL=\"/bin/ksh\" \
#        	-DINFO_FILE=\"/usr/local/info/dir\" \
#		-DNOOPTFILEDIR

#If you want the old xwpe-style ( < Version 1.2.0 )
# (Not so pretty, but a little bit more Turbo C like ):
# NONEWSTYLE=	-DNONEWSTYLE

#If you don't want the XWindow-Version of wpe and we:
# NOXWINDOW=	-DNOXWINDOW
#else
# XWINLIB=	-lX11

#If you only want the Editor (no Programming Environment):
# NOPROG=	-DNOPROG

#If you don't want the Debugger-Features:
# NODEBUGGER=	-DNODEBUGGER

#If configure or make fails look through the following lines
#and uncomment what Your system needs:

#XWindow Include Path:
# IXWINDOW=	-I/usr/X11R5/include

#XWINDOW Library Path:
# LXWINDOW=	-L/usr/X11R5/lib

#If You need a additional System V Path:
#include:
# ISYSV=		-I/usr/5include
#library:
# LSYSV=		-L/usr/5lib	  #library

#If You got a Curses Library
TLIB=		-lncurses

#If You didn't get a Curses Library
# TLIB=		-ltermlib
# DTERMCAP=	-DTERMCAP

#If You need the Posix Library:
# LPOSIX=		-lcposix

#If You need Network Libraries:
# LNET=			-linet

#If You don't use the GNU-Compiler:
# NOGNU=		-DNOGNU

#If Your Compiler isn't ANSI:
# NOANSI=		-DNOANSI

#If there don't have a printer Command;
# PRNTCMD=		-DNOPRINTER
#else put here your command to print:
# PRNTCMD=		-D\"lpr\"

#If You didn't get the Makros putc and getc:
# DEFPGC=	-DDEFPGC

#If You need a Declaration strstr and getcwd:
# NOSTRSTR=	-DNOSTRSTR

#If Your System don't define VSWTCH
# NOVSWTCH=	-DNOVSWTCH

#If You have to run ranlib after building a Library:
# RANLIB=	-DRANLIB

#If Your System get symbolic links
# NOSYMBLNKS=	-DNOSYMLINKS

#If Your System got xdb (not dbx)
# DEFXDB=	-DXDB

ECFLAGS=	$(IXWINDOW) $(LXWINDOW) $(ISYSV) $(NOGNU) \
		$(NOANSI) $(DTERMCAP) $(NOXWINDOW) $(NOPROG) $(NODEBUGGER) \
		$(DEFPGC) $(NOSTRSTR) $(NOVSWTCH) $(RANLIB) $(EXTDEFS) \
		$(PRNTCMD) $(NOSYMBLNKS) $(NONEWSTYLE) $(DEFXDB) $(SPFLAGS)

ELIBFLAGS=	$(LSYSV) $(LXWINDOW) $(TLIB) $(LPOSIX) $(XWINLIB) $(LNET) $(EXTLIBS)

ACFLAGS=	$(CFLAGS) $(DEFS) $(ECFLAGS) -D"DESTDIR=\"$(DESTDIR)\""

LIBFLAGS=	$(LIBS) $(ELIBFLAGS)

UNPROTOIZE=	unprotoize
UNPOPT=		-c "$(ACFLAGS)"

OFILES=		we_main.o we_block.o we_dos.o we_unix.o we_e_aus.o \
		we_edit.o we_fl_dos.o we_fl_fkt.o we_fl_unix.o we_hfkt.o \
		we_menue.o we_mouse.o we_opt.o we_wind.o we_term.o \
		we_prog.o we_progn.o we_debug.o we_xterm.o

CFILES=		we_main.c we_block.c we_dos.c  we_unix.c we_e_aus.c \
		we_edit.c we_fl_dos.c we_fl_fkt.c we_fl_unix.c we_hfkt.c \
		we_menue.c we_mouse.c we_opt.c we_wind.c we_term.c \
		we_prog.c we_progn.c we_debug.c we_xterm.c

HFILES=		attrb.h doskeys.h dosmakro.h edit.h keys.h \
		model.h progr.h swap.h unixkeys.h unixmakr.h \
		xkeys.h

wpedt:		$(OFILES)
		$(CC) $(ACFLAGS) $(OFILES) $(LIBFLAGS) -o wpedt

.c.o:		$(HFILES)
		$(CC) $(ACFLAGS) -c $<

clean:
		rm -f *.o wpedt xwpe wpe we xwe core *.ESV

install_fst:	wpedt
		if test ! -d $(DESTDIR); then  mkdir $(DESTDIR); fi
		if test ! -d $(LIBDIR); then  mkdir $(LIBDIR); fi
		if test ! -d $(WPELIBDIR); then  mkdir $(WPELIBDIR); fi
		rm -f $(DESTDIR)/wpe $(DESTDIR)/xwpe $(DESTDIR)/we $(DESTDIR)/xwe
		$(INSTALL) wpedt $(DESTDIR)/we
		chmod ugo+x $(DESTDIR)/we
		if test -z "$(NOXWINDOW)"; then \
		   ln $(DESTDIR)/we $(DESTDIR)/xwe; fi
		if test -z "$(NOPROG)" & test -z "$(NOXWINDOW)"; then \
		   ln $(DESTDIR)/we $(DESTDIR)/xwpe; fi
		if test -z "$(NOPROG)"; then \
		   ln $(DESTDIR)/we $(DESTDIR)/wpe; fi
		rm -f $(DESTDIR)/.we_help* $(DESTDIR)/.*wperc
		rm -f $(WPELIBDIR)/we_help
		if test ! -f $(WPELIBDIR)/we_synt_defs; then  \
		  $(INSTALL) .we_synt_defs $(WPELIBDIR)/we_synt_defs;  \
		  chmod ugo=r $(WPELIBDIR)/we_synt_defs; fi
		if test ! -d $(MANDIR); then  mkdir $(MANDIR); fi
		if test ! -d $(MANDIR)/man1; then  mkdir $(MANDIR)/man1; fi
		rm -f $(MANDIR)/man1/xwpe.1 $(MANDIR)/man1/xwe.1 
		rm -f $(MANDIR)/man1/wpe.1 $(MANDIR)/man1/we.1 
		$(INSTALL) xwe.1 wpe.1 we.1 $(MANDIR)/man1
		chmod ugo=r $(MANDIR)/man1/xwe.1 
		chmod ugo=r $(MANDIR)/man1/wpe.1 $(MANDIR)/man1/we.1 

install:	install_fst
		$(INSTALL) we.help_eng $(WPELIBDIR)/we_help
		chmod ugo=r $(WPELIBDIR)/we_help
		$(INSTALL) xwpe.1_eng $(MANDIR)/man1/xwpe.1
		chmod ugo=r $(MANDIR)/man1/xwpe.1

install_german:	install_fst
		$(INSTALL) we.help_gr $(WPELIBDIR)/we_help
		chmod ugo=r $(WPELIBDIR)/we_help
		$(INSTALL) xwpe.1_gr $(MANDIR)/man1/xwpe.1
		chmod ugo=r $(MANDIR)/man1/xwpe.1




