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