miscellaneous formatting
[aNetHack.git] / win / win32 / dgnstuff.mak
blob9196c5c53ac319e531cc4f9099d3f46fa49ea4ef
1 # $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
3 # Set all of these or none of them.
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
16 default: all
18 all: tools ..\util\dgn_yacc.c ..\util\dgn_lex.c
20 rebuild: clean all
22 clean:
23 -del ..\util\dgn_lex.c
24 -del ..\util\dgn_yacc.c
25 -del ..\include\dgn_comp.h
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
34 !IFDEF LEX
35 @echo Lex-alike set to $(LEX)
36 @echo LEXYYC set to $(LEXYYC)
37 !ENDIF
40 #==========================================
41 # Dungeon Compiler Stuff
42 #==========================================
44 ..\util\dgn_yacc.c ..\include\dgn_comp.h : ..\util\dgn_comp.y
45 !IF "$(YACC)"==""
46 @echo Using pre-built dgn_yacc.c and dgn_comp.h
47 @copy ..\sys\share\dgn_yacc.c ..\util\dgn_yacc.c
48 @copy ..\sys\share\dgn_comp.h ..\include\dgn_comp.h
49 !ELSE
50 chdir ..\util
51 $(YACC) -d dgn_comp.y
52 copy $(YTABC) $@
53 copy $(YTABH) ..\include\dgn_comp.h
54 @del $(YTABC)
55 @del $(YTABH)
56 chdir ..\build
57 !ENDIF
59 ..\util\dgn_lex.c: ..\util\dgn_comp.l
60 !IF "$(LEX)"==""
61 @echo Using pre-built dgn_lex.c
62 @copy ..\sys\share\dgn_lex.c $@
63 !ELSE
64 chdir ..\util
65 $(LEX) dgn_comp.l
66 copy $(LEXYYC) $@
67 @del $(LEXYYC)
68 chdir ..\build
69 !ENDIF