1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- FileName := VIDEO
- CC := MASM.EXE
- LD := LINK.EXE
- GDB := TD.EXE
- DISC_INSTRUMENTS := A:
- DISC_BUILDS := B:
- DISC_OUTPUT := C:
- CurrentDir := $(shell pwd -P)
- FullPathOutPut_TTY := $(shell tty)
- OutPutFile_TTY := $(shell basename ${FullPathOutPut_TTY})
- OutPutDir_TTY := $(FullPathOutPut_TTY:%/$(OutPutFile_TTY)=%)
- ASM_DIR := $(CurrentDir:%=%/bin)
- BUILD_DIR := $(CurrentDir:%=%/build)
- SRC_DIR := $(CurrentDir:%=%/src)
- OBJ := ${FileName:%=%.OBJ}
- SRC := ${FileName:%=%.ASM}
- all: compile_and_exit
- compile_and_exit: check_build
- cp $(SRC_DIR)/$(SRC) $(BUILD_DIR)/$(SRC)
- dosbox \
- -c "mount $(DISC_INSTRUMENTS) $(ASM_DIR)" \
- -c "mount $(DISC_BUILDS) $(BUILD_DIR)" \
- -c "mount $(DISC_OUTPUT) $(OutPutDir_TTY)" \
- -c "$(DISC_BUILDS)" \
- -c "PATH $(DISC_INSTRUMENTS)/" \
- -c "$(CC) $(SRC),,,,, >>$(DISC_OUTPUT)/$(OutPutFile_TTY)"\
- -c "$(LD) $(OBJ),,,,, >>$(DISC_OUTPUT)/$(OutPutFile_TTY)"\
- -c exit >> /dev/null
- rm $(BUILD_DIR)/$(FileName).{OBJ,ASM,MAP,LST,CRF}
- compile_without_exit: check_build
- cp $(SRC_DIR)/$(SRC) $(BUILD_DIR)/$(SRC)
- dosbox \
- -c "mount $(DISC_INSTRUMENTS) $(ASM_DIR)" \
- -c "mount $(DISC_BUILDS) $(BUILD_DIR)" \
- -c "mount $(DISC_OUTPUT) $(OutPutDir_TTY)" \
- -c "$(DISC_BUILDS)" \
- -c "PATH $(DISC_INSTRUMENTS)/" \
- -c "$(CC) $(SRC),,,,, " \
- -c "$(LD) $(OBJ),,,,, " \
- >> /dev/null
- rm $(BUILD_DIR)/$(FileName).{OBJ,ASM,MAP,LST,CRF}
-
- run: $(BUILD_DIR)/$(FileName).EXE
- dosbox \
- -c "mount $(DISC_BUILDS) $(BUILD_DIR)" \
- -c "mount $(DISC_OUTPUT) $(OutPutDir_TTY)" \
- -c "PATH $(DISC_BUILDS)/" \
- -c "$(FileName).EXE >>$(DISC_OUTPUT)/$(OutPutFile_TTY)" \
- -c exit >> /dev/null
- gdb: $(BUILD_DIR)/$(FileName).EXE
- dosbox \
- -c "mount $(DISC_INSTRUMENTS) $(ASM_DIR)" \
- -c "mount $(DISC_BUILDS) $(BUILD_DIR)" \
- -c "$(DISC_BUILDS)" \
- -c "PATH $(DISC_INSTRUMENTS)/;$(DISC_BUILDS)/" \
- -c "$(GDB) $(FileName).EXE" \
- -c exit >> /dev/null
- clear: $(BUILD_DIR)/$(FileName).EXE
- rm -r $<
- check_build:
- if [ ! -d "$(BUILD_DIR)" ]; then mkdir $(BUILD_DIR); fi
|