OSDN Git Service

Initial Import
[nethackexpress/trunk.git] / build / dgnstuff.mak
1 #Set all of these or none of them
2 #YACC   = byacc.exe
3 #LEX    = flex.exe
4 #YTABC   = y_tab.c
5 #YTABH   = y_tab.h
6 #LEXYYC  = lexyy.c
7
8 !IF "$(YACC)"!=""
9 @echo Yacc-alike set to $(YACC)
10 @echo YTABC set to $(YTABC)
11 @echo YTABH set to $(YTABH)
12 !ENDIF
13
14 !IF "$(LEX)"!=""
15 @echo Lex-alike set to $(LEX)
16 @echo LEXYYC set to $(LEXYYC)
17 !ENDIF
18
19 default: all
20
21 all: ..\util\dgn_yacc.c ..\util\dgn_lex.c
22
23 rebuild: clean all
24
25 clean:
26         -del ..\util\dgn_lex.c
27         -del ..\util\dgn_yacc.c
28         -del ..\include\dgn_comp.h
29
30 #==========================================
31 # Dungeon Compiler Stuff
32 #==========================================
33
34 ..\util\dgn_yacc.c ..\include\dgn_comp.h : ..\util\dgn_comp.y
35 !IF "$(YACC)"==""
36            @echo Using pre-built dgn_yacc.c and dgn_comp.h
37            @copy ..\sys\share\dgn_yacc.c ..\util\dgn_yacc.c
38            @copy ..\sys\share\dgn_comp.h ..\include\dgn_comp.h
39 !ELSE
40            chdir ..\util
41            $(YACC) -d dgn_comp.y
42            copy $(YTABC) $@
43            copy $(YTABH) ..\include\dgn_comp.h
44            @del $(YTABC)
45            @del $(YTABH)
46            chdir ..\build
47 !ENDIF
48
49 ..\util\dgn_lex.c: ..\util\dgn_comp.l
50 !IF "$(LEX)"==""
51            @echo Using pre-built dgn_lex.c
52            @copy ..\sys\share\dgn_lex.c $@
53 !ELSE
54            chdir ..\util
55            $(LEX) dgn_comp.l
56            copy $(LEXYYC) $@
57            @del $(LEXYYC)
58            chdir ..\build
59 !ENDIF