OSDN Git Service

adjust for patch
[jnethack/source.git] / win / win32 / levstuff.mak
1 # $NHDT-Date$  $NHDT-Branch$:$NHDT-Revision$
2
3 # Set all of these or none of them.
4 #
5 # bison and flex are the ones found in GnuWin32, which
6 # is probably the easiest set of these tools to find
7 # on Windows.
8 #
9 #YACC    = bison.exe -y
10 #LEX     = flex.exe
11 #YTABC   = y.tab.c
12 #YTABH   = y.tab.h
13 #LEXYYC  = lex.yy.c
14
15
16 default: all
17
18 all: tools ..\util\lev_yacc.c ..\util\lev_lex.c
19
20 rebuild: clean all
21
22 clean:
23         -del ..\util\lev_lex.c
24         -del ..\util\lev_yacc.c
25         -del ..\include\lev_comp.h
26
27 tools:
28 !IFDEF YACC
29         @echo Yacc-alike set to $(YACC)
30         @echo YTABC set to $(YTABC)
31         @echo YTABH set to $(YTABH)
32 !ENDIF
33
34 !IFDEF LEX
35         @echo Lex-alike set to $(LEX)
36         @echo LEXYYC set to $(LEXYYC)
37 !ENDIF
38
39 #==========================================
40 # Level Compiler Stuff
41 #==========================================
42
43 ..\util\lev_yacc.c ..\include\lev_comp.h: ..\util\lev_comp.y
44 !IFNDEF YACC
45            @echo Using pre-built lev_yacc.c and lev_comp.h
46            @copy ..\sys\share\lev_yacc.c ..\util\lev_yacc.c
47            @copy ..\sys\share\lev_comp.h ..\include\lev_comp.h
48 !ELSE
49            @echo Generating lev_yacc.c and lev_comp.h
50            chdir ..\util
51            $(YACC) -d lev_comp.y
52            copy $(YTABC) $@
53            copy $(YTABH) ..\include\lev_comp.h
54            @del $(YTABC)
55            @del $(YTABH)
56            chdir ..\build
57 !ENDIF
58
59 ..\util\lev_lex.c: ..\util\lev_comp.l
60 !IFNDEF LEX
61            @echo Using pre-built lev_lex.c
62            @copy ..\sys\share\lev_lex.c $@
63 !ELSE
64            @echo Generating lev_lex.c
65            chdir ..\util
66            $(LEX) lev_comp.l
67            copy $(LEXYYC) $@
68            @del $(LEXYYC)
69            chdir ..\build
70 !ENDIF
71