1 # WinBoard makefile using gcc
\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
13 # make compiling less spammy
\r
14 compile = @echo "$1"; $(CC) $(CFLAGS) $1
\r
21 # set this to 1 unless you don't mind linking with cygwin1.dll
\r
25 # set up for cygwin or not
\r
26 ifeq ($(USE_MINGW),1)
\r
28 LFCYG = -mno-cygwin -lmsvcrt
\r
33 FLEX = "flex.exe" # we need version 2.5.4 or later, cygwin's is 2.5.35
\r
34 # "c:/mingw/mingw32/bin/flex.exe"
\r
35 HC="C:/Program Files/Help Workshop/hcrtf" -xn
\r
36 DEFS = -D_WIN32_IE=0x0300 -DWIN32
\r
37 WARN = -Wall -Wno-char-subscripts -Wno-parentheses
\r
39 ifeq ($(USE_DEBUG),0)
\r
41 OPTS = -Os -frename-registers -funit-at-a-time -fstrict-aliasing -fstrength-reduce
\r
43 CFDEBUG = -D_DEBUG -DDEBUG -g
\r
45 CF = -c $(WARN) -pipe $(CFDEBUG) $(DEFS) -I. -I..
\r
46 CFLAGS = $(CF) $(ARCH) $(OPTS) $(CFCYG)
\r
47 LFLAGS = $(LFCYG) $(CFDEBUG) -fpic -s -mwindows -lwsock32 -lwinmm -lcomctl32
\r
54 rm -f *~ $(PROJ).exe $(PROJ).err $(PROJ).rbj $(PROJ).RES $(PROJ).res\
\r
55 *.sbr *.bsc *.o *.obj *.plg *.opt *.ncb *.debug *.bak *.gid *.GID\
\r
56 *.map *.pdb *.tmp $(PROJ).ini
\r
59 # Update the help file if necessary
\r
60 $(PROJ).hlp : $(PROJ).rtf
\r
63 @mv $(PROJ).hlp tmp.hlp
\r
64 @mv tmp.hlp $(PROJ).hlp # these moves to get the case right
\r
67 # Update the resource if necessary
\r
68 wbres.o: $(PROJ).rc $(PROJ).h resource.h
\r
69 windres --use-temp-file --include-dir .. $< -O coff -o $@
\r
72 # note: cygwin flex needs m4 package. cygwin-setup forgets this dependency
\r
73 # note2: use mingw flex instead... although I got cygwin's flex working (with m4),
\r
74 # it didn't produce a useable parser.c (1000's of errors)
\r
75 parser.c: ../parser.l
\r
76 $(FLEX) -oparser.c -L ../parser.l
\r
79 $(PROJ).exe: $(OBJS) $(PROJ).hlp
\r
80 $(CC) $(guiflags) $(OBJS) $(LFLAGS) -o $(PROJ).exe
\r
83 winboard.o: winboard.c config.h winboard.h ../common.h ../frontend.h ../backend.h \
\r
84 ../moves.h wgamelist.h defaults.h resource.h wclipbrd.h \
\r
85 wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h
\r
88 backend.o: ../backend.c config.h ../common.h ../frontend.h ../backend.h \
\r
89 ../parser.h ../moves.h ../zippy.h ../backendz.h ../gettext.h ../lists.h
\r
92 parser.o: parser.c config.h ../common.h ../backend.h ../parser.h \
\r
93 ../frontend.h ../moves.h ../lists.h
\r
96 moves.o: ../moves.c config.h ../backend.h ../common.h ../parser.h \
\r
97 ../moves.h ../lists.h
\r
100 lists.o: ../lists.c config.h ../lists.h ../common.h
\r
101 $(call compile, $<)
\r
103 gamelist.o: ../gamelist.c config.h ../lists.h ../common.h ../frontend.h \
\r
104 ../backend.h ../parser.h
\r
105 $(call compile, $<)
\r
107 wclipbrd.obj: wclipbrd.c config.h ../common.h ../frontend.h ../backend.h \
\r
108 winboard.h resource.h wclipbrd.h ../lists.h
\r
109 $(call compile, $<)
\r
111 wedittags.obj: wedittags.c config.h ../common.h winboard.h resource.h ../frontend.h \
\r
112 ../backend.h ../lists.h wedittags.h
\r
113 $(call compile, $<)
\r
115 wgamelist.obj: wgamelist.c config.h. ../common.h winboard.h resource.h ../frontend.h \
\r
116 ../backend.h wgamelist.h ../lists.h
\r
117 $(call compile, $<)
\r
119 woptions.obj: woptions.c config.h ../common.h ../frontend.h ../backend.h ../lists.h \
\r
120 defaults.h winboard.h resource.h
\r
121 $(call compile, $<)
\r
123 wengineo.obj: wengineo.c config.h ../common.h ../frontend.h ../backend.h \
\r
124 ../lists.h winboard.h resource.h wsnap.h
\r
125 $(call compile, $<)
\r
127 whistory.obj: whistory.c config.h ../common.h ../frontend.h ../backend.h \
\r
128 ../lists.h winboard.h resource.h wsnap.h
\r
129 $(call compile, $<)
\r
131 wevalgraph.obj: wevalgraph.c config.h ../common.h ../frontend.h ../backend.h \
\r
132 ../lists.h winboard.h resource.h wsnap.h
\r
133 $(call compile, $<)
\r
135 wlayout.obj: wlayout.c config.h ../common.h winboard.h resource.h
\r
136 $(call compile, $<)
\r
138 wsockerr.obj: wsockerr.c wsockerr.h
\r
139 $(call compile, $<)
\r
141 wsnap.obj: wsnap.c wsnap.h
\r
142 $(call compile, $<)
\r
144 pgntags.o: ../pgntags.c config.h ../common.h ../frontend.h ../backend.h \
\r
145 ../parser.h ../lists.h
\r
146 $(call compile, $<)
\r
148 zippy.o: ../zippy.c config.h ../common.h ../zippy.h ../frontend.h \
\r
149 ../backend.h ../backendz.h ../lists.h
\r
150 $(call compile, $<)
\r
152 book.o: ../book.c ../common.h ../backend.h ../lists.h
\r
153 $(call compile, $<)
\r
155 uci.o: ../uci.c ..//common.h ../backend.h ../frontend.h ../lists.h
\r
156 $(call compile, $<)
\r
159 $(call compile, $<)
\r