OSDN Git Service

upgrade to 3.6.2
[jnethack/source.git] / win / win32 / dgnstuff-mingw32.mak
1 # $NHDT-Date: 1524689255 2018/04/25 20:47:35 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $
2 # Copyright (c) 2018 by Michael Allison
3 # NetHack may be freely redistributed.  See license for details.
4
5 # Set all of these or none of them.
6 #
7 # bison and flex are the ones found in GnuWin32, which
8 # is probably the easiest set of these tools to find
9 # on Windows.
10
11 #YACC    = bison.exe -y
12 #LEX     = flex.exe 
13 #YTABC   = y.tab.c 
14 #YTABH   = y.tab.h 
15 #LEXYYC  = lex.yy.c 
16 SHELL=cmd.exe
17
18 default: all
19
20 all: tools ../util/dgn_yacc.c ../util/dgn_lex.c
21
22 rebuild: clean all
23
24 clean:
25         -del ..\util\dgn_lex.c
26         -del ..\util\dgn_yacc.c
27         -del ..\include\dgn_comp.h
28
29 tools:
30 ifneq "$(YACC)" ""
31         @echo Yacc-alike set to $(YACC)
32         @echo YTABC set to $(YTABC)
33         @echo YTABH set to $(YTABH)
34 endif
35
36 ifneq "$(LEX)" ""
37         @echo Lex-alike set to $(LEX)
38         @echo LEXYYC set to $(LEXYYC)
39 endif
40
41 #==========================================
42 # Dungeon Compiler Stuff
43 #==========================================
44
45 ../include/dgn_comp.h : ../util/dgn_comp.y
46 ifeq "$(YACC)" ""
47            @echo Using pre-built dgn_comp.h
48            chdir ..\include
49            copy /y ..\sys\share\dgn_comp.h
50            copy /b dgn_comp.h+,,
51            chdir ..\src
52 else
53            chdir ..\util
54            $(YACC) -d dgn_comp.y
55            copy $(YTABC) $@
56            copy $(YTABH) ..\include\dgn_comp.h
57            @del $(YTABC)
58            @del $(YTABH)
59            chdir ..\build
60 endif
61
62 ../util/dgn_yacc.c : ../util/dgn_comp.y
63 ifeq "$(YACC)" ""
64            @echo Using pre-built dgn_yacc.c
65            chdir ..\util
66            copy /y ..\sys\share\dgn_yacc.c
67            copy /b dgn_yacc.c+,,
68            chdir ..\src
69 else
70            chdir ..\util
71            $(YACC) -d dgn_comp.y
72            copy $(YTABC) $@
73            copy $(YTABH) ..\include\dgn_comp.h
74            @del $(YTABC)
75            @del $(YTABH)
76            chdir ..\build
77 endif
78
79 ../util/dgn_lex.c: ../util/dgn_comp.l
80 ifeq "$(LEX)" ""
81            @echo Using pre-built dgn_lex.c
82            chdir ..\util
83            copy /y ..\sys\share\dgn_lex.c
84            copy /b dgn_lex.c+,,
85            chdir ..\src
86 else
87            chdir ..\util
88            $(LEX) dgn_comp.l
89            copy $(LEXYYC) $@
90            @del $(LEXYYC)
91            chdir ..\build
92 endif
93