[BACK]Return to makefile.os2 CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot

File: [local] / OpenXM_contrib / gnuplot / Attic / makefile.os2 (download)

Revision 1.1.1.1 (vendor branch), Sun Jan 9 17:00:53 2000 UTC (24 years, 4 months ago) by maekawa
Branch: GNUPLOT
CVS Tags: VERSION_3_7
Changes since 1.1: +0 -0 lines

Import gnuplot 3.7

#
# $Id: makefile.os2,v 1.27 1998/04/14 00:15:54 drd Exp $
#
# Makefile for use with emx (and above) and GNUMake
#   on OS/2 3.0 and above (might also work for OS/2 2.x)
#
# last modification date: 19981205
#

# We depend on using cmd.exe (or a compatible one)
SHELL=cmd.exe

#
# ***************** Begin of Configuration section ***************************
#

# Comment out the definition lines to disable the according features:

# X11 driver
# requires installed XFree86
X11=1

# GD (GIF) device driver
# requires GD library (not part of gnuplot)
GD=1

# PNG device driver
# requires PNG and Z libraries (not part of gnuplot)
PNG=1

# VESAkit support
# requires SVGA- and VESA Kit (not part of gnuplot)
VESA=1

# GNU_ReadLine support
# requires GNU readline library (static or DLL; not part of gnuplot)
GNU_RL=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 PM terminal
# (not yet supported in official release)
# MOUSE=1

#
# ****************** End of Configuration section ****************************
#

#
# Miscellaneous setup
#

.PHONY: all runtime alldocs demo binaries infomin clean veryclean
.SUFFIXES: .c .trm .o .obj .exe

# seems to be a reasonable default ...
default: runtime

# a help screen
help:
	   @echo " Usage: $(MAKE) -f makefile.os2 target"
	   @echo "   target is one of:"
	   @echo "   all runtime alldocs demo binaries infomin help clean veryclean"

#
# Definitions of flags and symbols used by makefile.all and makefile.os2
#

# these definitions are used by makefile.all
T=term/
D=docs/
L=$(D)latextut/
M=demo/

#
# Definitions valid for all targets on OS/2
#

OS2DIR = os2
DOCDIR = docs
DEMODIR=demo
TERMDIR=term

OS2TERMS= $(TERMDIR)\pm.trm
ifdef X11
	OS2TERMS += $(TERMDIR)\x11.trm
endif
ifdef VESA
	OS2TERMS += $(TERMDIR)\emxvga.trm
endif


# where to place gnuplot.gih helpfile
HELPFILE = gnuplot.gih

#
# 3 sets of variables are defined and used to create
#  (1): gnuplot.exe
#   2 : gnupmdrv.exe (the PM-driver executable)
#   3 : utilities like doc2*.exe, bf_test.exe, ...
#
CC  = gcc
CC2 = gcc
CC3 = gcc
O  = o
O2 = obj
O3 = o

# Flags for compiler and linker under OS/2
OS2FLAGS = -DOS2 -DHELPFILE=\"$(HELPFILE)\"

# Flags for compiling with EMX/GCC
# Special note: -ffloat-store is necessary to avoid some
# strange behaviour (confirmed for gcc 2.7.x and graphics.c)
EMXSPECIFIC = -ffloat-store -DREADLINE -DHAVE_STRNICMP -DPIPES -DHAVE_STRERROR -DHAVE_SYS_SELECT_H -DHAVE_SYS_STAT_H
LIBS = 
ifdef GNU_RL
  EMXSPECIFIC += -DGNU_READLINE
  LIBS += -lreadline -ltermcap
endif

#
# Choose flags suitable for a debugging or for a production build
#
ifdef DEBUG
CFLAGS  = -g $(OS2FLAGS) $(EMXSPECIFIC) -Wall -Wno-comment -O0 -Zmt
LFLAGS  = -g -Zcrtdll -Zmt
CFLAGS2 = -g $(OS2FLAGS) $(EMXSPECIFIC) -Zomf -Zsys -Zmt -Wall -O0
LFLAGS2 = -g -Zomf -Zmt -Zcrtdll
CFLAGS3 = -g $(OS2FLAGS) $(EMXSPECIFIC) -Wall -Wno-comment -O0
LFLAGS3 = -g
else
CFLAGS  = $(OS2FLAGS) $(EMXSPECIFIC) -O2 -Wall -Wno-unused -Wno-comment -Zmt
LFLAGS  = -s -Zcrtdll -Zmt
CFLAGS2 = $(OS2FLAGS) $(EMXSPECIFIC) -Zomf -Zcrtdll -Zmt -O2 -Wall -Wno-unused
LFLAGS2 = -s -Zomf -Zmt -Zsys
CFLAGS3 = $(OS2FLAGS) $(EMXSPECIFIC) -O2 -Wall -Wno-unused -Wno-comment
LFLAGS3 = -s
endif

#
# Settings for the terminals to be included
#
TERMFLAGS = -I. -I$(T)

# All terminals available via #defines should be listed below
# Some terminals can be en/disabled in the configuration at the
# beginning of this Makefile.os2 but others may still require
# changes in term.h

#
# GIF-support
ifdef GD
TERMFLAGS += -DHAVE_LIBGD
TERMLIBS  += -lgd
endif
# PNG-support
ifdef PNG
TERMFLAGS += -DHAVE_LIBPNG
TERMLIBS  += -lpng -lz
endif
# SVGA-/VESAkit support
ifdef VESA
TERMFLAGS += -DEMXVESA
TERMLIBS  += -ljmgraph -lvesa
endif
# X11 support
ifdef X11
TERMFLAGS += -DX11
endif
# MOUSE support for PM terminal
ifdef MOUSE
TERMFLAGS += -DUSE_MOUSE
endif

#
# Default Rules
#
.c.$(O):
	$(CC)  $(CFLAGS) $(TERMFLAGS) -o $*.$(O) -c $*.c
.c.obj:
	$(CC2) $(CFLAGS2) -o $*.obj -c $*.c

#
# Include dependencies valid for all platforms from makefile.all
#
include makefile.all

#
# Pre-defined sets of targets:
#
all:         runtime demo
alldocs:     gnuplot.gih gnuplot.inf gnuplot.html gnuplot.info \
             gnuplot.dvi gnuplot.ps
runtime:     binaries infomin gnuplot.inf
infomin:     gnupmdrv.hlp gnuplot.gih
demo:        $(M)binary1 $(M)binary2 $(M)binary3
ifdef X11
binaries: gnuplot.exe gnupmdrv.exe gnuplot_x11.exe
else
binaries: gnuplot.exe gnupmdrv.exe
endif

OBJS = $(COREOBJS) version.$(O)
term.$(O): $(OS2TERMS) term.h

gnuplot.exe: $(OBJS)
	$(CC) -o $@ $(OBJS) $(TERMLIBS) $(LIBS) $(LFLAGS)

#
# Build the PM outboard driver
#
$(OS2DIR)\gnupmdrv.$(O2):  $(OS2DIR)\gnupmdrv.c   $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\gclient.$(O2):   $(OS2DIR)\gclient.c    $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\dialogs.$(O2):   $(OS2DIR)\dialogs.c    $(OS2DIR)\gnupmdrv.h  $(OS2DIR)\dialogs.h
$(OS2DIR)\print.$(O2):     $(OS2DIR)\print.c      $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\gnupmdrv.res :   $(OS2DIR)\gnupmdrv.rc  $(OS2DIR)\gnuplot.ico $(OS2DIR)\dialogs.h
	cd $(OS2DIR) & rc -r gnupmdrv.rc & cd ..
OS2OBJ = $(OS2DIR)\gnupmdrv.$(O2) $(OS2DIR)\gclient.$(O2) $(OS2DIR)\print.$(O2) \
         $(OS2DIR)\dialogs.$(O2)
gnupmdrv.exe: $(OS2OBJ) $(OS2DIR)\gnupmdrv.res $(OS2DIR)\gnupmdrv.def
	$(CC2) $(LFLAGS2) -o $@ $(OS2OBJ) $(OS2DIR)\gnupmdrv.res $(OS2DIR)\gnupmdrv.def
gnupmdrv.hlp: $(OS2DIR)\gnupmdrv.ipf
	ipfc $(OS2DIR)\gnupmdrv.ipf
	move $(OS2DIR)\gnupmdrv.hlp .

#
# Build the X11 outboard driver
#

# X11 libraries
X11LIBS = -lX11 -lsocket -Zcrtdll
# X11 includes
X11INCLUDES = -I$(X11ROOT)/xfree86/include
X11FLAGS= -D__ST_MT_ERRNO -Zmtd -Zsysv-signals

gnuplot_x11.exe: gplt_x11.o stdfn.o
	$(CC) $(LFLAGS) $(X11FLAGS) $(EMXSPECIFIC) -o $@ $^ $(X11LIBS)

gplt_x11.o: gplt_x11.c
	$(CC) $(CFLAGS) $(X11FLAGS) $(EMXSPECIFIC) $(X11INCLUDES) -c -o $@ $<

#
# Create documentation in various formats
#
# Change the call to LaTeX if the "latex2e" is not appropiate for you
# (and don't care about the strange way it's implemented ...)
gnuplot.dvi: gnuplot.tex
	copy gnuplot.tex $(DOCDIR)\gnuplot_2.tex
	cd $(DOCDIR) & latex2e gnuplot_2.tex
	move $(DOCDIR)\gnuplot_2.dvi gnuplot.dvi
	del $(DOCDIR)\gnuplot_2*
gnuplot.tex:  $(DOCDIR)\gnuplot.doc doc2tex.exe
	doc2tex $(DOCDIR)\gnuplot.doc gnuplot.tex
gnuplot.ps: gnuplot.dvi
	dvips -o gnuplot.ps gnuplot.dvi
gnuplot.inf:  $(DOCDIR)\gnuplot.ipf
	ipfc -i $(DOCDIR)\gnuplot.ipf gnuplot.inf
gnuplot.gih:  $(DOCDIR)\gnuplot.doc doc2gih.exe
	doc2gih $(DOCDIR)\gnuplot.doc gnuplot.gih
gnuplot.html: $(DOCDIR)\gnuplot.doc doc2html.exe
	doc2html $(DOCDIR)\gnuplot.doc gnuplot.html
gnuplot.info: $(DOCDIR)\gnuplot.doc doc2info.exe
	doc2info <$(DOCDIR)\gnuplot.doc >gnuplot.info
gnuplot.texi: $(DOCDIR)\gnuplot.doc $(DOCDIR)\doc2texi.pl
	perl $(DOCDIR)\doc2texi.pl $(DOCDIR)\gnuplot.doc >$(DOCDIR)\gnuplot.texi
gnuplot.rtf:  $(DOCDIR)\gnuplot.doc doc2rtf.exe
	doc2rtf $(DOCDIR)\gnuplot.doc gnuplot.rtf
gnuplot.ms:   $(DOCDIR)\gnuplot.doc doc2ms.exe
	doc2ms $(DOCDIR)\gnuplot.doc gnuplot.ms
$(DOCDIR)\gnuplot.ipf:  $(DOCDIR)\gnuplot.doc doc2ipf.exe
	doc2ipf $(DOCDIR)\gnuplot.doc $(DOCDIR)\gnuplot.ipf
#
# Tools for converting the documentation from docs\gnuplot.doc
# in various formats
#
doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
            $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(DOCDIR)\allterm.h
#
# To include all terminal documentations in the documentation
# uncomment the following 2 lines
# doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
#           $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(DOCDIR)\allterm.h

$(DOCDIR)\allterm.h: $(CORETERM)
#   echo > $@
	cd $(TERMDIR) & type *.trm > ..\$@
doc2gih.exe:  $(DOCDIR)\doc2gih.c $(DOCDIR)\termdoc.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2gih.c $(DOCDIR)\termdoc.c
doc2ipf.exe:  $(DOCDIR)\doc2ipf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2ipf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2tex.exe:  $(DOCDIR)\doc2tex.c $(DOCDIR)\termdoc.c $(OS2TERMS) $(DOCDIR)\allterm.h
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2tex.c $(DOCDIR)\termdoc.c
doc2html.exe: $(DOCDIR)\doc2html.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2html.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2info.exe: $(DOCDIR)\doc2info.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2info.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2rtf.exe:  $(DOCDIR)\doc2rtf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2rtf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2ms.exe:   $(DOCDIR)\doc2ms.c $(DOCDIR)\termdoc.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2ms.c $(DOCDIR)\termdoc.c
#
# Create binary demo files
#
$(M)binary1: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)binary2: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)binary3: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)bf_test.exe : bf_test.c binary.$(O) alloc.$(O)
	$(CC3) $(CFLAGS3) -o $@ bf_test.c binary.$(O) alloc.$(O)
#
# Clean up
#

# Clean up all files temporary used
clean:
	IF EXIST *.$(O)                  DEL *.$(O)
	IF EXIST *.$(O2)                 DEL *.$(O2)
	cd $(OS2DIR) & IF EXIST *.$(O2)  DEL *.$(O2)
	IF EXIST $(OS2DIR)\gnupmdrv.res  DEL $(OS2DIR)\gnupmdrv.res
	IF EXIST demo\bf_test.exe        DEL demo\bf_test.exe
	IF EXIST doc2*.exe               DEL doc2*.exe
	IF EXIST gnuplot.ipf             DEL gnuplot.ipf
	IF EXIST core                    DEL core
	IF EXIST $(DOCDIR)\allterm.h     DEL $(DOCDIR)\allterm.h

# Clean up ALL files that were not part of the source distribution
veryclean: clean
	IF EXIST *.exe.exe               DEL gnuplot.exe
	IF EXIST gnupmdrv.hlp            DEL gnupmdrv.hlp
	IF EXIST gnuplot.gih             DEL gnuplot.gih
	IF EXIST gnuplot.inf             DEL gnuplot.inf
	IF EXIST gnuplot.dvi             DEL gnuplot.dvi
	IF EXIST gnuplot.htm             DEL gnuplot.htm
	IF EXIST gnuplot.tex             DEL gnuplot.tex
	IF EXIST gnuplot.texi            DEL gnuplot.texi
	IF EXIST gnuplot.info            DEL gnuplot.info
	IF EXIST gnuplot.ms              DEL gnuplot.ms
	IF EXIST gnuplot.rtf             DEL gnuplot.rtf
	IF EXIST gnuplot.ps              DEL gnuplot.ps
	cd demo & IF EXIST binary?       DEL binary?