############################################################################# # mined text editor makefile - cygwin ############################################################################# # Where and how to install # installation root, usually empty root = $(INSTALLROOT) # configuration of installation directories: # * [l]rundir refers to the "Mined runtime support library" - # it contains the online help file, auxiliary scripts (some of which # might actually be installed in .../bin, too), configuration samples etc. # * [l]docdir is optional and refers to the mined web documentation # (a copy of the mined home page). # directories for target "make install" prefix = $(root)/usr bindir = $(prefix)/bin mandir = $(prefix)/share/man rundir = $(prefix)/share/mined docdir = $(prefix)/share/doc/mined # directories for target "make localinstall" (for cygwin, same as install) lprefix = $(root)/usr lbindir = $(lprefix)/bin lmandir = $(lprefix)/share/man lrundir = $(lprefix)/share/mined ldocdir = $(lprefix)/share/doc/mined #INSTALL = install --mode=+r,u+w INSTALL = install -m 644 INSTALLBIN = install #INSTALL = /bin/cp -p #INSTALLBIN = /bin/cp -p ############################################################################# # system environment adaption # select library directory LIBDIR = /usr/lib # find library with termcap API # prefer libtermcap over libncurses so the stand-alone binary # will work with only cygwin1.dll (cygncurses*.dll not needed) # (actually libncurses could also be linked statically but would # be slightly larger) liblist = \ ls $(LIBDIR)/libtermcap.a; \ ls $(LIBDIR)/libncurses.a; \ ls $(LIBDIR)/libncursesw.dll.a; \ ls $(LIBDIR)/libncurses.dll.a; \ # select first library found from list, replace with -l... if static firstlib = sed -e "s,\($(LIBDIR).*\)/lib\([^/]*\)\.a,-L\1 -l\2," -e "1 p" -e d termcap = $(shell ( $(liblist) ) 2> /dev/null | $(firstlib) ) # libtest: target at bottom (must not be first target) ############################################################################# # compilation target options # terminal handling mode 1: termio SCREEN = -DTERMIO # link termcap functions: #SLIB = -ltermcap # usual termcap library #SLIB = -L/usr/lib/termcap -ltermcap # if deprecated (Linux) #SLIB = -lcurses # may work on System V Unix too (Solaris) SLIB = $(termcap) # terminal handling mode 2: sgtty (old, BSD) #SCREEN = -DSGTTY #SLIB = -ltermcap # terminal handling mode 3: curses # Choose curses only if other options don't work # (see COMPILE.DOC for discussion). # Use target "make minced" to use UTF-8 enabled ncurses (>= 5.4), # or see separate makefile.curses for options with legacy curses. # select operating system flavour (define sysV if on System V flavour) SYSTEM = -Dunix -DsysV #SYSTEM = -Dunix -DsysV -DFDSET #SYSTEM = -Dunix # select operating system environment DEFS = -Dunix -Dpc #DEFS = -Dunix -Dpc -mno-cygwin -D__CYGWIN__ # this mode doesn't work # collection of system parameters for compilation SYSFLAGS = $(SCREEN) $(SYSTEM) $(DEFS) ############################################################################# # link options # link dynamically LDOPTS=-d y # -d n links statically GLDOPTS= # -static links statically ############################################################################# # compiler selection and compiler-specific options # (source warnings, optimisation and debug) CC=gcc include mkinclud.$(CC) #LDL:= ############################################################################# # make actions SCREENOBJ=io.o keyboard.o MOUSELIB= KEYMAPSDEP=keymaps/_keymaps.h include mkinclud.mak ############################################################################# # cygwin installation EXE=.exe extrainstall=$(MAKE) -f makefile.cygwin installcygwin installcygwin: mkdir -p $(prefix)/share/doc/Cygwin $(prefix)/share/doc/mined cp -fp ../README.cygwin $(prefix)/share/doc/Cygwin/mined.README cp -fp ../README* ../VERSION ../LICENSE.GNU ../*.DOC ../CHANGES $(prefix)/share/doc/mined/ $(installscript) ../usrshare/bin/wmined* $(bindir) mkdir -p `dirname $(prefix)`/etc/postinstall cp -fp $(rundir)/setup_install/bin/postinstall `dirname $(prefix)`/etc/postinstall/mined.sh $(rundir)/setup_install/bin/mkicon ############################################################################# # test targets libtest: ( $(liblist) ) | cat echo $(termcap) ############################################################################# # end