Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / makefile.cyg
diff --git a/config/makefile.cyg b/config/makefile.cyg
new file mode 100644 (file)
index 0000000..1e3d2dd
--- /dev/null
@@ -0,0 +1,395 @@
+# Hey, Emacs, this is a -*- Makefile -*-
+#
+# $Id: makefile.cyg,v 1.27.2.2 2008/02/23 11:19:39 mikulik Exp $
+#
+#
+# GNUPLOT Makefile for Cygwin on WinNT and Win95/98/2000
+#
+# To compile gnuplot for WinXX:
+#
+# - check the beginning of this file settings you may want to change
+#   You'll have to tell it where to find the Help Compiler, among other
+#   things.
+# - compile the package: go to directory 'gnuplot' and therefrom run
+#       make -C src -f ../config/makefile.cyg
+# - resource compiler used is windres.exe in Cygwin
+# - note pdf, png, and gif libraries if used have to be build for Cygwin
+#   with -mno-cygwin option
+# - -static used for static linking to libz-w.a and libpng-w.a
+#
+
+#
+# ************** Begin of Configuration section ************************
+
+#
+
+# Comment out the definition lines to disable the according features:
+
+# GIF, PNG, JPEG device drivers
+# Requires gd library. There are two possibilities how to configure these
+# drivers for use in gnuplot, depending on the gd version. See README.1ST for
+# more details. 
+#
+# You should compile gnuplot with GD library v2.0 or newer.
+# This library writes PNG, GIF and JPEG images.
+# If libgd has been compiled with TrueType font support, then you can use
+# scaled TrueType fonts in png images. If not, then uncomment FREETYPE.
+# Requires GD, PNG and Z libraries, optionally libfreetype.
+#
+NEWGD=1
+JPEG=1
+FREETYPE=1
+
+# PDF device driver
+# may require PNG and Z libraries based on particular PDF library used
+#PDF=1
+
+# DEBUGging support
+# creates binaries suitable for debugging. Some bugs may come and go
+# as opposed to a production build since we lower the optimization level
+#DEBUG=1
+
+# MOUSE support for the windows terminal
+MOUSE=1
+
+# PIPES: define if you would prefer support of pipes undef Windows (e.g.
+# plot '<awk -f preprocess.awk my.dat'). Drawback: wgnuplot.exe keeps attached
+# to a console=DOS window it was launched from, or it opens a new one.
+# Also does not work properly with pgnuplot.
+#PIPES=1
+
+# Below you can adapt paths according to your software setup:
+
+# Where to place gnuplot.gih helpfile:
+HELPFILE = wgnuplot.hlp
+
+# Where to install the PostScript prologue files, relatively to the executable
+# wgnuplot.exe
+GNUPLOT_PS_DIR = share/PostScript
+
+# Destination directory, used in 'make install':
+DESTDIR = /cygdrive/c/Apps/gnuplot
+
+# give here the path to Gygwin GCC compiler unless it is already in PATH
+
+#GCCPATH = /bin/
+#GCCPATH =
+
+# Do you want some special optimization?
+CFLAGS =
+
+
+# To compile the .hlp file you need hcw either out of Microsoft SDK or MS Help
+# Workshop. The latter can be obtained at www.helpmaster.com/help/devaids.htm.
+# Put the path to hcw here unless it is already in PATH:
+HCWPATH = /cygdrive/c/Program\ Files/Help\ Workshop/
+HCW = $(HCWPATH)hcw
+# Switches are for HCW 4.03:
+HCWFLAG =
+
+# Choose which windres/rc do you want to use (GNU windres or MS RC):
+GNU_RC = 1
+ifndef GNU_RC
+  # If uncommented GNU_RC above and rc.exe not in PATH, then set:
+  MSSDK = c:/mssdk
+endif
+
+# GNU sort
+#GNUSORT = gsort.exe
+GNUSORT = /usr/bin/sort
+
+#
+# *************** End of Configuration section *************************
+
+
+#
+#         There shouldn't be anything to be changed below this line
+# **********************************************************************
+
+#
+
+
+CC = $(GCCPATH)gcc
+LD = $(GCCPATH)gcc
+
+RM = rm -f
+CP = cp -p
+
+ifdef DEBUG
+  CFLAGS += -g
+  LDFLAGS += -g
+else
+  CFLAGS += -O2
+  LDFLAGS += -s
+endif
+
+ifdef PIPES
+  OPTS += -DPIPES
+  LDFLAGS2 = -mconsole
+endif
+
+TOP = ..
+TERMFLAGS = -DGNUPLOT_PS_DIR=\"$(GNUPLOT_PS_DIR)\" -I$(TOP)/term
+TERMLIBS =
+
+CFLAGS += -I. -D_Windows -DCYGWIN -mno-cygwin -DHAVE_CONFIG_H\
+       $(OPTS)
+
+# -I/usr/local/include
+
+ifdef MOUSE
+  CFLAGS += -DUSE_MOUSE=1 -DWIN_IPC
+endif
+
+ifdef NEWGD
+  GD=1
+  PNG=1
+endif
+
+ifdef GD
+  CFLAGS += -DHAVE_LIBGD
+  TERMLIBS += -lgd
+endif
+
+ifdef PNG
+  CFLAGS += -DHAVE_LIBPNG
+  TERMLIBS += -lpng -lz
+endif
+
+ifdef NEWGD
+  CFLAGS += -DHAVE_GD_GIF -DGIF_ANIMATION -DHAVE_GD_PNG
+ifdef JPEG
+  CFLAGS += -DHAVE_GD_JPEG
+  TERMLIBS += -ljpeg
+endif
+ifdef FREETYPE
+  CFLAGS += -DHAVE_GD_TTF
+  TERMLIBS += -lfreetype
+endif
+endif
+
+ifdef PDF
+  CFLAGS += -DHAVE_LIBPDF
+  TERMLIBS += -lpdf-w -ltiff-w
+ifndef PNG
+  NEED_PNG_W = 1
+else
+ifndef NEWGD
+  NEED_PNG_W = 1
+endif
+endif
+ifdef NEED_PNG_W
+  CFLAGS += -DHAVE_LIBPNG
+  TERMLIBS += -lpng-w -lz-w
+endif
+endif
+
+ifdef GNU_RC
+  # RC = /bin/windres
+  RC  = $(GCCPATH)windres
+  RCFLAGS = --include-dir win \
+       --define __WIN32__ --define __WIN95__ --define MSRC \
+       --define __GNUWIN32__ --define WIN32
+  RCOUT = wgplt_res.$(O)
+  RES2COFF = echo wgplt_res.$(O)
+else
+  RC = $(MSSDK)/bin/rc
+  RCFLAGS = -v -i$(MSSDK)/include -iwin \
+       -dWIN32 -dMSRC
+  RCOUT = -fowgnuplot.res
+  RES2COFF = res2coff -i wgnuplot.res -o wgplt_res.$(O)
+endif
+
+# macros for makefile.all
+O=o
+T=../term/
+D=../docs/
+L=docs/latex/
+M=../demo/
+
+
+default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe pgnuplot.exe
+
+all: default gnuplot.ps gnuplot.pdf
+
+
+# include the 'core makefile template'
+include makefile.all
+
+OBJS = $(COREOBJS) version.$(O) gpexecute.$(O)
+
+WINOBJS = winmain.$(O) wgnuplib.$(O) wgraph.$(O) wprinter.$(O) wtext.$(O) \
+       wpause.$(O) wmenu.$(O)
+
+WINDOWS = makefile.win makefile.nt README.win win/wcommon.h \
+       win/wgnuplib.c win/wgnuplib.def win/wgnuplib.h win/wgnuplib.rc \
+       win/wgnuplot.def win/wgnuplot.hpj win/wgnuplot.mnu win/wgraph.c \
+       win/winmain.c win/wmenu.c win/wpause.c win/wprinter.c \
+       win/wresourc.h win/wtext.c win/wtext.h win/geticon.c \
+       $(D)doc2rtf.c $(T)win.trm win/grpicon.ico win/texticon.ico
+
+
+# default rules
+.SUFFIXES: .exe .o .c
+.c.o:
+       $(CC) -c $(CFLAGS) $*.c
+
+LDLIBS = -L/usr/local/lib -lkernel32 -lgdi32
+
+wgnuplot.exe: $(OBJS) $(WINOBJS) win/wgnuplot.def wgplt_res.$(O) texticon.ico grpicon.ico
+       $(LD) $(LDFLAGS) $(LDFLAGS2) -mwindows -mno-cygwin -o $@ \
+               $(OBJS) $(WINOBJS) wgplt_res.$(O) $(LDLIBS) $(TERMLIBS)
+
+pgnuplot.exe: win/pgnuplot.c version.$(O)
+       gcc -O2 -s -mno-cygwin -DHAVE_STDBOOL_H -o $@ \
+               win/pgnuplot.c version.$(O) -I. -luser32
+
+
+# Rules:
+
+wgplt_res.$(O):  win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h texticon.ico grpicon.ico
+       $(RC) $(RCFLAGS) win/wgnuplot.rc $(RCOUT) --include-dir=win
+       $(RES2COFF)
+
+show.$(O): show.c plot.h setshow.h
+       $(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\" -DBINDIR=\"$(bindir)\" $<
+
+term.$(O): term.c term.h plot.h setshow.h bitmap.h $(CORETERM)
+       $(CC) -c $(CFLAGS) $(TERMFLAGS) $<
+
+version.$(O): version.c
+
+WINDEPS = win/wgnuplib.h win/wcommon.h win/wresourc.h
+
+winmain.$(O): win/winmain.c win/wgnuplib.h win/wtext.h plot.h
+       $(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\"  win/winmain.c
+
+wgnuplib.$(O): win/wgnuplib.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wgnuplib.c
+
+wmenu.$(O): win/wmenu.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wmenu.c
+
+wtext.$(O): win/wtext.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wtext.c
+
+wpause.$(O): win/wpause.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wpause.c
+
+wprinter.$(O): win/wprinter.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wprinter.c
+
+wgraph.$(O): win/wgraph.c $(WINDEPS)
+       $(CC) -c $(CFLAGS) win/wgraph.c
+
+wgnuplot.mnu: win/wgnuplot.mnu
+       $(CP) $^ $@
+
+# extract icons from wgnuplot.rc
+texticon.ico: grpicon.ico
+
+grpicon.ico: geticon.exe win/wgnuplot.rc
+       ./geticon win/wgnuplot.rc
+
+geticon.exe: win/geticon.c
+       $(LD) $(LDFLAGS) -o $@ win/geticon.c
+
+# convert gnuplot.doc to gnuplot.rtf
+$(HELPFILE): doc2rtf.exe $(D)gnuplot.doc win/wgnuplot.hpj
+       ./doc2rtf $(D)gnuplot.doc win/gnuplot.rtf
+       $(HCW) /c /e win/wgnuplot.hpj
+
+doc2rtf.exe: $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
+       $(LD) $(LDFLAGS) -o $@ -DWINDOWS_NO_GUI $(CFLAGS) -I. -I$(D) -I$(T) $^
+
+#make binary demo files
+$(M)bf_test.exe : bf_test.c dbinary.$(O) alloc.$(O)
+       $(LD) $(LDFLAGS) $(CFLAGS) -U_Windows -o $@ $^
+       (cd ../demo ; ./bf_test.exe )
+
+# _Windows causes wtext.h to define fread() etc
+dbinary.$(O): binary.c
+       $(CC) -c $(CFLAGS) -U_Windows -o $@ $<
+
+
+#
+# Create config.h
+#
+$(OBJS) $(WINOBJS) dbinary.$(O): config.h
+config.h: ../config/config.cyg
+       cp -p $< $@
+
+# Create documentation in various formats
+#
+ALL_TERMINALS_DOC=1
+ifdef ALL_TERMINALS_DOC
+# Generate TeX documentation with the complete list of all terminals
+# (gnuplot.tex should be the same on all platforms):
+SORT_TERMINALS=1
+ifdef SORT_TERMINALS
+# sort alphabetically all terminals (note: req. GNU sort, not from MS)
+allterm.h: $(CORETERM)
+       @echo "Building allterm.h"
+       @for e in `egrep "^[    ]*START_HELP" $(CORETERM) |\
+            $(GNUSORT) -f -t':' -k2` ; do \
+         f=`echo $$e |cut -d\: -f1` ; s=`echo $$e | cut -d\: -f2` ;\
+         sed -n "/^[   ]*$$s/,/^[      ]*END_HELP/p" $$f ; \
+       done >$@
+else
+# sequence of terminals according to "ls term/*.trm":
+allterm.h: $(CORETERM)
+       @echo "Building allterm.h"
+       @cat ../term/*.trm > allterm.c
+       $(CPP) $(CFLAGS) -I$../term -DTERM_DRIVER_H -DTERM_HELP allterm.c | \
+         sed '/^ *$$/d;/^#/d' > allterm.h
+       @rm -f allterm.c
+endif
+doc2tex.exe: $(D)doc2tex.c $(D)termdoc.c allterm.h
+       $(LD) $(LDFLAGS) -o $@ -DWINDOWS_NO_GUI -DALL_TERM_DOC $(CFLAGS) -I. -I$(D) -I../term -I$(T) $(D)doc2tex.c $(D)termdoc.c
+else
+# Old version: generate documentation with only currently used terminals:
+doc2tex.exe: $(D)doc2tex.c $(D)termdoc.c
+       $(LD) $(LDFLAGS) -o $@ -DWINDOWS_NO_GUI $(CFLAGS) -I. -I$(D) -I$(T) $^
+endif
+
+gnuplot.tex: $(D)gnuplot.doc doc2tex.exe
+       doc2tex $(D)gnuplot.doc gnuplot.tex
+
+# Call LaTeX three times to get the toc right.
+gnuplot.dvi: gnuplot.tex $(D)titlepag.tex
+       cp gnuplot.tex $(D)gp_tex2.tex
+       cp $(D)../VERSION $(D)
+       cd $(D) && latex gp_tex2.tex && latex gp_tex2.tex && latex gp_tex2.tex
+       mv $(D)gp_tex2.dvi gnuplot.dvi
+       rm -f $(D)gp_tex2.*
+gnuplot.ps: gnuplot.dvi
+       dvips -o gnuplot.ps gnuplot.dvi
+gnuplot.pdf: gnuplot.tex $(D)titlepag.tex
+       cp gnuplot.tex $(D)gp_tex2.tex
+       cp $(D)../VERSION $(D)
+       cd $(D) && pdflatex gp_tex2.tex && pdflatex gp_tex2.tex \
+               && pdflatex gp_tex2.tex
+       mv $(D)gp_tex2.pdf gnuplot.pdf
+       rm -f $(D)gp_tex2.*
+
+
+# clean up temporary files
+clean:
+       $(RM) config.h *.$(O) wgnuplot.map wgnuplot.res win/gnuplot.rtf
+       $(RM) doc2rtf.exe win/wgnuplib.res wgnuplib.map wgnuplot.lib
+       $(RM) $(M)bf_test.exe *.ico geticon.exe allterm.h allterm.c
+       $(RM) gnuplot.tex gnuplot.dvi gnuplot.ps gnuplot.pdf
+
+realclean: veryclean
+veryclean: clean
+       $(RM) wgnuplot.exe wgnuplot.hlp wgnuplot.mnu wgnuplot.gid
+       $(RM) $(M)binary[123] $(M)fit.log $(M)soundfit.par
+       $(RM) pgnuplot.exe
+
+# now move the whole stuff to its destination
+install: default
+       mkdir -p $(DESTDIR)
+       cp wgnuplot.exe $(DESTDIR)/wgnuplot.exe
+       cp win/wgnuplot.mnu $(DESTDIR)/wgnuplot.mnu
+       cp wgnuplot.hlp $(DESTDIR)/wgnuplot.hlp
+       cp pgnuplot.exe $(DESTDIR)/pgnuplot.exe