all : install
-install: envchk $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag
+install: $(O)envchk.tag $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag
@echo Done.
$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
# defer to the steps in ..\win\win32\levstuff.mak
#
-$(U)lev_yacc.c $(INCL)\lev_comp.h: $(U)lev_comp.y
- nmake -nologo -f ..\win\win32\levstuff.mak default
+$(U)lev_yacc.c:
+ nmake -nologo -f ..\win\win32\levstuff.mak $(U)lev_yacc.c
+
+$(U)lev_lex.c:
+ nmake -nologo -f ..\win\win32\levstuff.mak $(U)lev_lex.c
+
+$(INCL)\lev_comp.h:
+ nmake -nologo -f ..\win\win32\levstuff.mak $(INCL)\lev_comp.h
$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
@$(cc) $(cflagsBuild) -Fo$@ $(U)lev_yacc.c
-$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \
- $(U)lev_lex.c
+$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) $(U)lev_lex.c
@$(cc) $(cflagsBuild) -Fo$@ $(U)lev_lex.c
$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H)
#
# defer to the steps in ..\win\win32\dgnstuff.mak
#
-$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
- nmake -nologo -f ..\win\win32\dgnstuff.mak default
+$(U)dgn_yacc.c:
+ nmake -nologo -f ..\win\win32\dgnstuff.mak $(U)dgn_yacc.c
+
+$(INCL)\dgn_comp.h:
+ nmake -nologo -f ..\win\win32\dgnstuff.mak $(INCL)\dgn_comp.h
+
+$(U)dgn_lex.c:
+ nmake -nologo -f ..\win\win32\dgnstuff.mak $(U)dgn_lex.c
$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
@$(cc) $(cflagsBuild) -Fo$@ $(U)dgn_yacc.c
# options.
#==========================================
-envchk:
+$(O)envchk.tag:
! IF "$(TARGET_CPU)"=="x64"
@echo Windows x64 64-bit target build
! ELSE
# @echo Warning, the CL Environment variable is defined:
# @echo CL=$(CL)
! ENDIF
+ echo envchk >$@
#==========================================
#=========== SECONDARY TARGETS ============
if exist $(O)nhraykey.lib del $(O)nhraykey.lib
if exist $(O)nhraykey.map del $(O)nhraykey.map
if exist $(O)nhraykey.PDB del $(O)nhraykey.PDB
+ if exist $(O)envchk.tag del $(O)envchk.tag
if exist $(O)obj.tag del $(O)obj.tag
if exist $(O)sp_lev.tag del $(O)sp_lev.tag
if exist $(O)uudecode.MAP del $(O)uudecode.MAP
# Dungeon Compiler Stuff
#==========================================
-..\util\dgn_yacc.c ..\include\dgn_comp.h : ..\util\dgn_comp.y
+..\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
+ @echo Using pre-built dgn_comp.h
+ chdir ..\include
+ copy /b ..\sys\share\dgn_comp.h +,,
+ chdir ..\src
+!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_yacc.c : ..\util\dgn_comp.y
+!IF "$(YACC)"==""
+ @echo Using pre-built dgn_yacc.c
+ chdir ..\util
+ copy /b ..\sys\share\dgn_yacc.c +,,
+ chdir ..\src
!ELSE
chdir ..\util
$(YACC) -d dgn_comp.y
..\util\dgn_lex.c: ..\util\dgn_comp.l
!IF "$(LEX)"==""
@echo Using pre-built dgn_lex.c
- @copy ..\sys\share\dgn_lex.c $@
+ chdir ..\util
+ copy /b ..\sys\share\dgn_lex.c +,,
+ chdir ..\src
!ELSE
chdir ..\util
$(LEX) dgn_comp.l
# Level Compiler Stuff
#==========================================
-..\util\lev_yacc.c ..\include\lev_comp.h: ..\util\lev_comp.y
+..\include\lev_comp.h: ..\util\lev_comp.y
!IFNDEF YACC
- @echo Using pre-built lev_yacc.c and lev_comp.h
- @copy ..\sys\share\lev_yacc.c ..\util\lev_yacc.c
- @copy ..\sys\share\lev_comp.h ..\include\lev_comp.h
+ @echo Using pre-built lev_comp.h
+ chdir ..\include
+ copy /b ..\sys\share\lev_comp.h +,,
+ chdir ..\src
!ELSE
@echo Generating lev_yacc.c and lev_comp.h
chdir ..\util
copy $(YTABH) ..\include\lev_comp.h
@del $(YTABC)
@del $(YTABH)
- chdir ..\build
+ chdir ..\src
+!ENDIF
+
+..\util\lev_yacc.c: ..\util\lev_comp.y
+!IFNDEF YACC
+ @echo Using pre-built lev_yacc.c
+ chdir ..\util
+ copy /b ..\sys\share\lev_yacc.c +,,
+ chdir ..\src
+!ELSE
+ @echo Generating lev_yacc.c and lev_comp.h
+ chdir ..\util
+ $(YACC) -d lev_comp.y
+ copy $(YTABC) $@
+ copy $(YTABH) ..\include\lev_comp.h
+ @del $(YTABC)
+ @del $(YTABH)
+ chdir ..\src
!ENDIF
..\util\lev_lex.c: ..\util\lev_comp.l
!IFNDEF LEX
@echo Using pre-built lev_lex.c
- @copy ..\sys\share\lev_lex.c $@
+ chdir ..\util
+ copy /b ..\sys\share\lev_lex.c +,,
+ chdir ..\src
!ELSE
@echo Generating lev_lex.c
chdir ..\util
$(LEX) lev_comp.l
copy $(LEXYYC) $@
@del $(LEXYYC)
- chdir ..\build
+ chdir ..\src
!ENDIF