File: makefile.cyg

package info (click to toggle)
gnuplot 3.7.1p1-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,808 kB
  • ctags: 4,418
  • sloc: ansic: 43,279; lisp: 661; makefile: 647; asm: 539; sh: 416; objc: 379; csh: 297; pascal: 194; perl: 138
file content (160 lines) | stat: -rw-r--r-- 4,669 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# To compile gnuplot for WinNT and Win95
#
#
# Changed for use with MinGW32 by HBB
# Modified for Cygwin beta 20.1 which includes MINGW32
# Resource compiler is windres.exe in Cygwin b20.1
# Note png and gif libraries if used have to be build for Cygwin b20.1 with -mno-cygwin option
#

# where to place gnuplot.gih helpfile
HELPFILE = wgnuplot.hlp
TOP = .
# May need to add include/mingw32 for Cygwin b20, but not for b20.1
#WIN32INC= /e/Cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/mingw32
WIN32INC=/usr/local/include
#WIN32LIBS =
#WIN32FLAGS= -DWINVER=0x0400
CPU=i586

CC = gcc
LD = gcc
WINCFLAGS = -O2 -mno-cygwin $(WIN32FLAGS) -I$(TOP) -I$(WIN32INC) -D_Windows -D__WIN32__ -DWIN32 -DHAVE_STRNICMP -DREADLINE=1 -DNO_GIH -DGP_INLINE=inline -DHAVE_SLEEP -DANSI_C -DHAVE_GETCWD -DNEAR= -DHAVE_LIBPNG -DHAVE_LIBGD -DNO_SETVBUF -DCYGWIN
WINLDFLAGS = -s -mwindows -mno-cygwin -L/usr/local/lib  # -v # -Wl,--verbose
CFLAGS = -g -O2 -I$(TOP) -DNO_GIH -DHAVE_STRNICMP -DREADLINE -DHAVE_SLEEP -DHAVE_GETCWD -DNEAR= -DWIN32
LDFLAGS = -g #-v # -Wl,--verbose

RM = rm -f
CP = cp -p

#You'll need the MS Platform SDK, for now. Enter its path here
MSSDK = e:/sdk

HCW = $(MSSDK)/bin/hcw
#RC = $(MSSDK)/bin/rc

RC  = windres.exe
RCFLAGS=--define __WIN32__ --define __WIN95__ --define __GNUWIN32__ --define MSRC --define WIN32

# see other terminal defines in term.h
TERMFLAGS = -I$(TOP)/term


# 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 $(WINCFLAGS) $*.c

WINLDLIBS = -lkernel32 -lgdi32 -lpng -lz -lgd

wgnuplot.exe: $(OBJS) $(WINOBJS) win/wgnuplot.def wgnuplot_res.o texticon.ico grpicon.ico 
	$(LD) $(WINLDFLAGS) -o $@ $(OBJS) $(WINOBJS) wgnuplot_res.o $(WINLDLIBS)

# rules

wgnuplot_res.o :  win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h texticon.ico grpicon.ico
	$(RC) -i win/wgnuplot.rc -o wgnuplot_res.o $(RCFLAGS)

show.o: show.c plot.h setshow.h
	$(CC) -c $(WINCFLAGS) -DHELPFILE=\"$(HELPFILE)\" -DGNUPLOT_BINDIR=\"$(bindir)\" -c $<

term.$(O): term.c term.h plot.h setshow.h bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
	$(CC) -c $(WINCFLAGS) $(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 $(WINCFLAGS) -DHELPFILE=\"$(HELPFILE)\"  win/winmain.c

wgnuplib.$(O): win/wgnuplib.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) win/wgnuplib.c

wmenu.$(O): win/wmenu.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) win/wmenu.c

wtext.$(O): win/wtext.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) win/wtext.c

wpause.$(O): win/wpause.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) win/wpause.c

wprinter.$(O): win/wprinter.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) win/wprinter.c

wgraph.$(O): win/wgraph.c $(WINDEPS)
	$(CC) -c $(WINCFLAGS) 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.c 
	$(LD) $(LDFLAGS) $(CFLAGS) -I. -o $@ $^
	(cd demo ; ./bf_test.exe )
#	cd ..

# _Windows causes wtext.h to define fread() etc
dbinary.$(O): binary.c
	$(CC) -c $(CFLAGS) -o $@ $^

#bf_test.$(O): bf_test.c
#	$(CC) -c $(CFLAGS) -o $@ $^

#alloc.$(O): alloc.c
#	$(CC) -c $(CFLAGS) -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