GNU make looks first for a file called GNUmakefile, ahead of looking for Makefile and then makefile. Renaming sys/windows/Makefile.mingw32 to sys/windows/GNUmakefile allows: o src/GNUmakefile (for use by GNU make) and src/Makefile (for use Microsoft nmake) to both reside in the src folder during build. o src/GNUmakefile will be used by GNU make, without having to explicitly specify "-f GNUmakefile" on the GNU make command line. o src/Makefile will be used by Microsoft nmake, without having to explicitly specify "-f Makefile" on the Microsoft nmake command line. For the gcc build, the movemement of sys/windows/GNUmakefile needs to be copied to src/GNUmakefile as part of the build process (see sys/windows/build-msys2.txt). For the Microsoft Visual Studio command line build with nmake, sys/windows/Makefile.nmake needs to be copied to src/Makefile as part of the build process (see sys/windows/build-nmake.txt). They are both copied to the src folder from their respective repository source file names when the nhsetup.bat file is used.
127 lines
3.3 KiB
Plaintext
127 lines
3.3 KiB
Plaintext
.PHONY: depend cleandep
|
|
|
|
cce = gcc -E -MM -MT "$(@:d=o) $@"
|
|
|
|
# Copy all $(cc) commands w/ their targets from GNUmakefile, 3rd party code unnecessary
|
|
# Replace .o w/ .d, $(cc) w/ $(cce)
|
|
# Check extraordinary "OBJ): " and handle them properly
|
|
# Check all CLEAN_FILE lines, add obj files to $(OBJS4DEP)
|
|
# Run
|
|
# make depend
|
|
|
|
$(HL)/%.d: $(SRC)/%.c | $(HL)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OM)/%.d: $(SRC)/%.c $(NHLUAH) | $(OM)
|
|
$(cce) $(CFLAGSU) -DENUM_PM $< -o$@
|
|
|
|
$(OM)/%.d: $(U)%.c $(NHLUAH) | $(OM)
|
|
$(cce) $(CFLAGSU) -DENUM_PM $< -o$@
|
|
|
|
$(OR)/recover.d: $(U)recover.c | $(OR)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OT)/tiletxt.d: $(WSHR)/tilemap.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) -DTILETEXT $< -o$@
|
|
|
|
$(OT)/%.d: $(WSHR)/%.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OT)/%.d: $(SRC)/%.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OT)/tilete32.d: $(WSHR)/tiletext.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) -DTILE_X=32 -DTILE_Y=32 $< -o$@
|
|
|
|
$(OT)/tiletx32.d: $(WSHR)/tilemap.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) -DTILETEXT -DTILE_X=32 -DTILE_Y=32 $< -o$@
|
|
|
|
$(GIF32OBJ:o=d): $(WSHR)/gifread.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) -DTILE_X=32 -DTILE_Y=32 $< -o$@
|
|
|
|
$(BMP32OBJ:o=d): $(WSHR)/tile2bmp.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) -DTILE_X=32 -DTILE_Y=32 $< -o$@
|
|
|
|
$(OT)/panic.d: $(UTIL)/panic.c $(NHLUAH) | $(OT)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OTM)/tilemap.d: $(WSHR)/tilemap.c $(NHLUAH) | $(OTM)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OTM)/%.d: $(SRC)/%.c $(NHLUAH) | $(OTM)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(OU)/uudecode.d: $(SSYS)/uudecode.c | $(OU)
|
|
$(cce) $(CFLAGS) $(CONSOLEDEF) $< -o$@
|
|
|
|
$(ODLB)/%.d: $(SRC)/%.c $(NHLUAH) | $(ODLB)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(ODLB)/%.d: $(U)%.c $(NHLUAH) | $(ODLB)
|
|
$(cce) $(CFLAGSU) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(SRC)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/cppregex.d: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CPPFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(SSYS)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(SNDSYS)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(MSWSYS)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(MSWIN)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(WSHR)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSW) $< -o$@
|
|
|
|
$(ONHW)/%.d: $(WCURSES)/%.c $(NHLUAH) | $(ONHW)
|
|
$(cce) $(CFLAGSNH) $(PDCINCL) $< -o$@
|
|
|
|
$(ONH)/%.d: $(SRC)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/cppregex.d: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONH)
|
|
$(cce) $(CPPFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(SSYS)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(SNDSYS)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(MSWSYS)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(MSWIN)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(WSHR)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(TTY)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $< -o$@
|
|
|
|
$(ONH)/%.d: $(WCURSES)/%.c $(NHLUAH) | $(ONH)
|
|
$(cce) $(CFLAGSNH) $(PDCINCL) $< -o$@
|
|
|
|
OBJS4DEP = $(MOBJS) $(ROBJS) $(HLHACKLIBOBJS) \
|
|
$(TOBJS) $(GIFOBJ) $(GIF32OBJ) $(PPMOBJ) $(BMP32OBJ) $(T32OBJS) $(TUCOMMON) \
|
|
$(TMOBJS) $(UOBJS) $(DLBOBJS) $(NHWOBJS) $(NHOBJS)
|
|
DEP_TARGETS = $(OBJS4DEP:o=d)
|
|
|
|
depend: fetchlua fetchpdcurses $(DEP_TARGETS)
|
|
@cat $(DEP_TARGETS) > .depend
|
|
|
|
cleandep:
|
|
@-rm -f $(DEP_TARGETS) .depend
|
|
|
|
clean: cleandep
|
|
# end of file
|