# makefile for make Copyright Julian H Stacey @(#) Version 2.2 # This makefile works for both # 1) berkley unix/make/bourne shell # 2) msdos with a minix make that has been ported, and command.com. # Do not change the syntax without checking on both machines. LINT_LNT = bsd.lnt ms.lnt v7.lnt v6.lnt SRC_C = make.c SRC_CH = $(SRC_C) common.h SOURCES = $(SRC_CH) makefile all: @echo It would have been better to have typed cd .. make @echo We will assume unix and sufficient process ram for a nested make. $(INST_DIR)/make -f ../include/make/system_5 \ -f ../include/make/unix -f makefile unix bak: transfer -s $(SOURCES) unix: start $(INST_DIR)make end msdos: start $(INST_DIR)make$(EXE) end start: @echo Started making make. end: @echo Finished making make. $(INST_DIR)make: $(INC_LOCAL)/../../include/vsl.h make.c @echo Generating $@ @echo On BSD unix cant overwrite target executable if it is running, @echo so must move target, but move time kept short as possible. @echo Removing any possible old temporary files. -rm $@.nu $(CC) -o $@.nu $(FLAGS) -I$(INC_LOCAL) make.c strip $@.nu @echo If previous make aborted our precious old binary already in $@.mv mv $@ $@.mv @echo Ensuring we have at least old transfer present. cp $@.mv $@ @echo Replacing old transfer with new - if existent. -cp $@.nu $@ @$(CHGRP) $@ @$(CHMOD) $(CHMOD_ARGS) $@ $(INST_DIR)make.exe: $(INC_LOCAL)/vsl.h $(VSL_LIB_BIG).$(OBJ) make.c @echo Generating $@ dir $@ @if not exist $@ echo $@ does not exist @if exist $@ echo $@ does exist @if not exist $@ echo Insert large model compiler. @if not exist $@ pause $(CC) $(LARGE_MODEL) -o $(DV_ROOT)make.exe $(FLAGS) -I$(INC_LOCAL) \ make.c $(VSL_LIB_BIG).$(OBJ) del make.obj exepack $(DV_ROOT)make.exe $@ del $(DV_ROOT)make.exe $(EXPIRE) $(REPLACE) @echo adjusting msdos stack allocation @echo the exemod below Causes a Stack overflow, human must do it later. pause -exemod $@ /stack c000 $(CHGRP) $@ @$(CHMOD) $(CHMOD_ARGS) $@ @if not exist $@ echo Insert small model compiler. @if not exist $@ pause Please insert compiler disc with $@. clean: cleanlint -rm make.$(OBJ) make$(EXE) -rm $(INST_DIR)/make.nu # Note we do not rm $(INST_DIR)make.mv as if make fails, this may be only # copy of usable binary realclean: lintclean: cleanlint cleanlint: -rm $(LINT_LNT) lint: $(LINT_LNT) ls -l $(LINT_LNT) LINT_FLAGS = hbxac # h Apply a number of heuristic tests to attempt to intuit # b Report break statements that cannot be reached. (This # x Report variables referred to by extern declarations, # a Report assignments of long values to int variables. # c Complain about casts which have questionable portabil- # n Do not check compatibility against the standard library. bsd.lnt: $(SRC_CH) lint -$(LINT_FLAGS) $(SRC_C) > $@ v7.lnt: $(SRC_CH) lint -$(LINT_FLAGS)n -DV7 -Uns32000 -I/usr/include/v7 $(SRC_C) > $@ v6.lnt: $(SRC_CH) lint -$(LINT_FLAGS)n -DV6 -Uns32000 -I/usr/include/v6 $(SRC_C) > $@ # standard V6 doesnt have many include files. ms.lnt: $(SRC_CH) lint -$(LINT_FLAGS)n -DMSDOS -DNO_EXT_KEYS -Uunix -Uns32000 \ -I/usr/include/ms $(SRC_C) | grep -v fprintf | grep -v open > $@ # NO_EXT_KEYS is to avoid the cdecl ansi C component of the header files # ms stdio needs VARARGS 2 adding, but im not doing it. # JHS exepack stack note # If make.exe says Error 2009: Not enough space for environment # it may be because you have used too much stack with # exemod make.exe -stack f000 # try instead exemod make.exe -stack a000 # -AL : Large model # -Os optimise for space # -FPi -FPc -FPa are all float options, all produce the same size # executable, , because there are no floats or doubles in make.c # phils standard flags: -Ox -FPi -Gs -DMSDOS # -Ox maximal optimise, relax alias checking, favor code size, remove stack probes # -FPi in line float instructions + select emulator doesnt need FPchip # -Gs remove stack probes