# Unix base make file for the NE editor.

# This is not called directly, but should be called via the
# system-dependent make file from the top-level make file.

# The system-dependent makefile (called OS_Make_<sysname>)
# should set appropriate values in CC, CFLAGS, INCLUDE, LFLAGS
# and LIB_TERMINAL.


# CC contains the name of the command to run the C compiler.

# As well as compiler-specific flags, CFLAGS may contain the following:
#
#   -Dunixwinsz     Should be set for Unix systems that support dynamic
#                   re-sizing of windows, in particular, the TIOCGWINSZ
#                   ioctl and the SIGWINCH signal.
#
#   -DHAVE_TERMCAP  Should be set on systems where termcap is used. If
#                   it is not set, the use of terminfo is assumed.
#
#   -DNO_VDISCARD   Should be set for Unix systems where the VDISCARD
#                   terminal control character is not supported.
#
#   -DNEED_MEMMOVE  Should be set for SunOS 4 systems where the memmove()
#                   function isn't standardly supplied (depends on the
#                   compiler and libraries - acc has it; gcc does not).
#                   A version of memmove(), controlled by this switch,
#                   is supplied in the elocal.sunos4.c file.

# INCLUDE contains any -I options that are necessary for compilation.

# LFLAGS contains options for the linker. This can include -L options
# that come before NE's object modules in the command.

# LIB_TERMINAL contains the appropriate library for the type of
# terminal handling in use (typically either -lcurses or -ltermcap).


# Compile step for the modules

.SUFFIXES:  .o .c
.c.o:;      $(CC) -c $(CFLAGS) $(INCLUDE) $*.c


# Object module list, excluding regular expression modules

OBJ = debug.o ecrash.o ecmdarg.o ecmdcomp.o ecmdsub.o ecutcopy.o \
  edisplay.o eerror.o ee1.o ee2.o ee3.o ee4.o efile.o eglobals.o einit.o \
  ekey.o ekeysub.o eline.o elocal.o ematch.o erdseqs.o escrnrdl.o \
  escrnsub.o estore.o rdargs.o scommon.o sunix.o sysunix.o


# Linking steps; removal of eversion.o ensures new date each time

nenew:        $(OBJ) ecompR.o ematchR.o eversion.o
	      $(CC) -o nenew $(LFLAGS) $(OBJ) ecompR.o ematchR.o eversion.o \
	        $(LIB_TERMINAL) -lc
	      chmod 755 nenew
	      /bin/rm -f eversion.o

nenewp:       $(OBJ) pcre.o ecompP.o eversion.o
	      $(CC) -c -DRETYPE=P $(CFLAGS) $(INCLUDE) eversion.c
	      $(CC) -o nenewp $(LFLAGS) $(OBJ) pcre.o ecompP.o \
	        eversion.o $(LIB_TERMINAL) -lc
	      chmod 755 nenewp
	      /bin/rm -f eversion.o

# End
