aea08d9d756d9e29f100de8d3268167d563d8d62
[xboard.git] / winboard / makefile.gcc
1 # WinBoard makefile using gcc\r
2 \r
3 \r
4 PROJ=winboard\r
5 \r
6 \r
7 OBJS=backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o\\r
8  parser.o wbres.o wclipbrd.o wedittags.o wengineo.o wevalgraph.o\\r
9  wgamelist.o whistory.o winboard.o wlayout.o woptions.o wsnap.o\\r
10  wsockerr.o help.o\r
11 \r
12 \r
13 # make compiling less spammy\r
14 compile = @echo "$1"; $(CC) $(CFLAGS) $1\r
15 compile = $(CC) $(CFLAGS) $1\r
16 \r
17 \r
18 # Debugging?\r
19 USE_DEBUG=0\r
20 \r
21 \r
22 # JAWS support?\r
23 JAWS=0\r
24 \r
25 \r
26 # set this to 1 unless you don't mind linking with cygwin1.dll\r
27 USE_MINGW=1\r
28 \r
29 \r
30 # set up for cygwin or not\r
31 ifeq ($(USE_MINGW),1)\r
32 CFCYG = -mno-cygwin\r
33 LFCYG = -mno-cygwin -lmsvcrt\r
34 endif\r
35 \r
36 CC = gcc\r
37 FLEX = "flex.exe" # we need version 2.5.4 or later, cygwin's is 2.5.35\r
38 #      "c:/mingw/mingw32/bin/flex.exe"\r
39 HC="C:/Program Files/Help Workshop/hcrtf" -xn\r
40 DEFS = -D_WIN32_IE=0x0300 -DWIN32\r
41 ifeq ($(JAWS),1)\r
42   DEFS += -DJAWS\r
43 endif\r
44 WARN = -Wall -Wno-char-subscripts -Wno-parentheses\r
45 ARCH =\r
46 ifeq ($(USE_DEBUG),0)\r
47   CFDEBUG = -DNDEBUG\r
48   OPTS = -Os -frename-registers -funit-at-a-time -fstrict-aliasing -fstrength-reduce\r
49 else\r
50   CFDEBUG = -D_DEBUG -DDEBUG -g\r
51 endif\r
52 CF = -c $(WARN) -pipe $(CFDEBUG) $(DEFS) -I. -I..\r
53 CFLAGS = $(CF) $(ARCH) $(OPTS) $(CFCYG)\r
54 LFLAGS = $(LFCYG) $(CFDEBUG) -fpic -s -mwindows -lwsock32 -lwinmm -lcomctl32\r
55 \r
56 all: $(PROJ).exe\r
57 \r
58 \r
59 clean:\r
60         rm -f *~ $(PROJ).exe $(PROJ).err $(PROJ).rbj $(PROJ).RES $(PROJ).res\\r
61         *.sbr *.bsc *.o *.obj *.plg *.opt *.ncb *.debug *.bak *.gid *.GID\\r
62         *.map *.pdb *.tmp $(PROJ).ini\r
63 \r
64 \r
65 # Update the help file if necessary\r
66 $(PROJ).hlp : $(PROJ).rtf\r
67         $(HC) $(PROJ).hpj\r
68         @cat $(PROJ).err\r
69         @mv $(PROJ).hlp tmp.hlp\r
70         @mv tmp.hlp $(PROJ).hlp # these moves to get the case right\r
71 \r
72 \r
73 # Update the resource if necessary\r
74 #wbres.o: $(RESDEPS)\r
75 wbres.o: $(PROJ).rc $(PROJ).h resource.h\r
76         windres $(DEFS) --use-temp-file --include-dir .. $< -O coff -o $@\r
77 \r
78 \r
79 # note: cygwin flex needs m4 package.  cygwin-setup forgets this dependency\r
80 # note2: use mingw flex instead... although I got cygwin's flex working (with m4),\r
81 #        it didn't produce a useable parser.c (1000's of errors)\r
82 parser.c: ../parser.l\r
83         $(FLEX) -oparser.c -L ../parser.l\r
84 \r
85 \r
86 $(PROJ).exe: $(OBJS) $(PROJ).hlp\r
87         $(CC) $(guiflags) $(OBJS) $(LFLAGS) -o $(PROJ).exe\r
88 \r
89 \r
90 winboard.o: winboard.c config.h winboard.h ../common.h ../frontend.h ../backend.h \\r
91         ../moves.h wgamelist.h defaults.h resource.h wclipbrd.h \\r
92         wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h\r
93         $(call compile, $<)\r
94 \r
95 backend.o: ../backend.c config.h ../common.h ../frontend.h ../backend.h \\r
96         ../parser.h ../moves.h ../zippy.h ../backendz.h ../gettext.h ../lists.h\r
97         $(call compile, $<)\r
98 \r
99 parser.o: parser.c config.h ../common.h ../backend.h ../parser.h \\r
100         ../frontend.h ../moves.h ../lists.h\r
101         $(call compile, $<)\r
102 \r
103 moves.o: ../moves.c config.h ../backend.h ../common.h ../parser.h \\r
104         ../moves.h ../lists.h\r
105         $(call compile, $<)\r
106 \r
107 lists.o: ../lists.c config.h ../lists.h ../common.h\r
108         $(call compile, $<)\r
109 \r
110 gamelist.o: ../gamelist.c config.h ../lists.h ../common.h ../frontend.h \\r
111         ../backend.h ../parser.h\r
112         $(call compile, $<)\r
113 \r
114 wclipbrd.o: wclipbrd.c config.h ../common.h ../frontend.h ../backend.h \\r
115         winboard.h resource.h wclipbrd.h ../lists.h\r
116         $(call compile, $<)\r
117 \r
118 wedittags.o: wedittags.c config.h ../common.h winboard.h resource.h ../frontend.h \\r
119         ../backend.h ../lists.h wedittags.h\r
120         $(call compile, $<)\r
121 \r
122 wgamelist.o: wgamelist.c config.h. ../common.h winboard.h resource.h ../frontend.h \\r
123         ../backend.h wgamelist.h ../lists.h\r
124         $(call compile, $<)\r
125 \r
126 woptions.o: woptions.c config.h ../common.h ../frontend.h ../backend.h ../lists.h \\r
127         defaults.h winboard.h resource.h\r
128         $(call compile, $<)\r
129 \r
130 wengineo.o: wengineo.c config.h ../common.h ../frontend.h ../backend.h \\r
131         ../lists.h winboard.h resource.h wsnap.h\r
132         $(call compile, $<)\r
133 \r
134 whistory.o: whistory.c config.h ../common.h ../frontend.h ../backend.h \\r
135         ../lists.h winboard.h resource.h wsnap.h\r
136         $(call compile, $<)\r
137 \r
138 wevalgraph.o: wevalgraph.c config.h ../common.h ../frontend.h ../backend.h \\r
139         ../lists.h winboard.h resource.h wsnap.h\r
140         $(call compile, $<)\r
141 \r
142 wlayout.o: wlayout.c config.h ../common.h winboard.h resource.h\r
143         $(call compile, $<)\r
144 \r
145 wsockerr.o: wsockerr.c wsockerr.h\r
146         $(call compile, $<)\r
147 \r
148 help.o: help.c help.h\r
149         $(call compile, $<)\r
150 \r
151 wsnap.o: wsnap.c wsnap.h\r
152         $(call compile, $<)\r
153 \r
154 pgntags.o: ../pgntags.c config.h ../common.h ../frontend.h ../backend.h \\r
155         ../parser.h ../lists.h\r
156         $(call compile, $<)\r
157 \r
158 zippy.o: ../zippy.c config.h ../common.h ../zippy.h ../frontend.h \\r
159         ../backend.h ../backendz.h ../lists.h\r
160         $(call compile, $<)\r
161 \r
162 book.o: ../book.c ../common.h ../backend.h ../lists.h\r
163         $(call compile, $<)\r
164 \r
165 uci.o: ../uci.c ..//common.h ../backend.h ../frontend.h ../lists.h\r
166         $(call compile, $<)\r
167 \r
168 %.o: %.c\r
169         $(call compile, $<)\r