# To compile gnuplot for WinNT and Win95 # # Changed for use with Cygwin/MinGW32 by HBB # compile the package with make -f makefile.mgw # the make utility for MinGW32 can be obtained the MinGW sites # # you need Cygwin's windres as of Mingw32-egcs-1.1b # this makefile was tested with Ming32egcs-1.1b and # Microsoft Help Workshop 4.03 # # # where to place gnuplot.gih helpfile HELPFILE = wgnuplot.hlp TOP = . DESTDIR=/Progra~1/Gnuplot3.7 # give here the path to your compiler (preferrably MinGW's one) GCCPATH=/mingw32/bin/ # -c means don't link # -I means extra include directory # -O2 means optimize for speed # -g means prepare for debugging # -mpentium means optimise for Pentium processor # -mpentiumpro means optimize for Pentium II and Pro procesors CC = $(GCCPATH)gcc LD = $(GCCPATH)gcc CFLAGS = -g -O2 -I$(TOP) -D_Windows -DNO_GIH -DHAVE_STRNICMP \ -DREADLINE -DGP_INLINE=inline -DHAVE_SLEEP -DANSI_C \ -DNO_SETVBUF -DHAVE_GETCWD -DNEAR= LDFLAGS = -g RM = rm -f CP = cp -p # # to compile the .hlp file you need hcw # either out of Microsoft SDK or # Microsoft Help Workshop # the latter can be obtained at www.helpmaster.com/help/devaids.htm # put the path to hcw here # # the followind switches are for HCW 4.03 # HCWPATH=/Program\ Files/Help\ Workshop/ HCW = $(HCWPATH)hcw HCWFLAG= # # it seems for the moment that we need cygwin's windres # as the one shipped with mingw32/egcs 1.1b is buggy # the one with cygwin b20.1 is ok, so give here the complete path # RCPATH = /cygnus/cygwin-b20/H-i586-cygwin32/bin RC = windres RCFLAGS=--include-dir /mingw32/include \ --define __WIN32__ --define __WIN95__ --define MSRC \ --define __GNUWIN32__ RCOUT=wgplt_res.o RES2COFF=echo wgplt_res.o # # you can also use MS SDK's # #MSSDK=f:/mssdk/ #RC=$(MSSDK)/bin/rc #RCFLAGS=-v -i$(MSSDK)/include -iwin \ # -dWIN32 -dMSRC #RCOUT=-fowgnuplot.res #RES2COFF=res2coff -i wgnuplot.res -o wgplt_res.o # see other terminal defines in term.h TERMFLAGS = -I$(TOP)/term # There shouldn't be anything to be changed below this line #======================================================================= # 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 # include the 'core makefile template' include makefile.all OBJS = $(COREOBJS) version.$(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 \ docs/doc2rtf.c term/win.trm win/grpicon.ico win/texticon.ico # default rules .SUFFIXES: .exe .o .c .c.o: $(CC) -c $(CFLAGS) $*.c LDLIBS = -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -ladvapi32 wgnuplot.exe: $(OBJS) $(WINOBJS) win/wgnuplot.def wgplt_res.o texticon.ico grpicon.ico $(LD) $(LDFLAGS) -mwindows -o $@ $(OBJS) $(WINOBJS) wgplt_res.o $(LDLIBS) # rules wgplt_res.o : win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h texticon.ico grpicon.ico $(RC) $(RCFLAGS) win/wgnuplot.rc $(RCOUT) $(RES2COFF) show.o: show.c plot.h setshow.h $(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\" -DGNUPLOT_BINDIR=\"$(bindir)\" -c $< term.$(O): term.c term.h plot.h setshow.h bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7) $(CC) -c $(CFLAGS) $(TERMFLAGS) term.c 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 docs/gnuplot.doc win/wgnuplot.hpj ./doc2rtf docs/gnuplot.doc win/gnuplot.rtf $(HCW) \/c \/e win/wgnuplot.hpj doc2rtf.exe: docs/doc2rtf.c docs/termdoc.c docs/xref.c $(LD) $(LDFLAGS) -o $@ $(CFLAGS) -I. -Idocs -Iterm $^ #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 ) # cd .. # _Windows causes wtext.h to define fread() etc dbinary.$(O): binary.c $(CC) -c $(CFLAGS) -U_Windows -o $@ $^ # clean up temporary files clean: $(RM) *.$(O) wgnuplot.map wgnuplot.res win/gnuplot.rtf $(RM) doc2rtf.exe win/wgnuplib.res wgnuplib.map wgnuplot.lib $(RM) demo/bf_test.exe *.ico geticon.exe realclean: veryclean veryclean: clean $(RM) wgnuplot.exe wgnuplot.hlp wgnuplot.mnu wgnuplot.gid $(RM) demo/binary[123] demo/fit.log demo/soundfit.par # 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