File: dgnstuff.mak

package info (click to toggle)
glhack 1.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,748 kB
  • sloc: ansic: 208,571; cpp: 13,139; yacc: 2,005; makefile: 1,152; lex: 377; sh: 121; awk: 89; sed: 11
file content (59 lines) | stat: -rw-r--r-- 1,258 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#Set all of these or none of them
#YACC   = byacc.exe
#LEX	= flex.exe
#YTABC   = y_tab.c
#YTABH   = y_tab.h
#LEXYYC  = lexyy.c

!IF "$(YACC)"!=""
@echo Yacc-alike set to $(YACC)
@echo YTABC set to $(YTABC)
@echo YTABH set to $(YTABH)
!ENDIF

!IF "$(LEX)"!=""
@echo Lex-alike set to $(LEX)
@echo LEXYYC set to $(LEXYYC)
!ENDIF

default: all

all: ..\util\dgn_yacc.c ..\util\dgn_lex.c

rebuild: clean all

clean:
	-del ..\util\dgn_lex.c
	-del ..\util\dgn_yacc.c
	-del ..\include\dgn_comp.h

#==========================================
# Dungeon Compiler Stuff
#==========================================

..\util\dgn_yacc.c ..\include\dgn_comp.h : ..\util\dgn_comp.y
!IF "$(YACC)"==""
	   @echo Using pre-built dgn_yacc.c and dgn_comp.h
	   @copy ..\sys\share\dgn_yacc.c ..\util\dgn_yacc.c
	   @copy ..\sys\share\dgn_comp.h ..\include\dgn_comp.h
!ELSE
	   chdir ..\util
	   $(YACC) -d dgn_comp.y
	   copy $(YTABC) $@
	   copy $(YTABH) ..\include\dgn_comp.h
	   @del $(YTABC)
	   @del $(YTABH)
	   chdir ..\build
!ENDIF

..\util\dgn_lex.c: ..\util\dgn_comp.l
!IF "$(LEX)"==""
	   @echo Using pre-built dgn_lex.c
	   @copy ..\sys\share\dgn_lex.c $@
!ELSE
	   chdir ..\util
	   $(LEX) dgn_comp.l
	   copy $(LEXYYC) $@
	   @del $(LEXYYC)
	   chdir ..\build
!ENDIF