#############################################################
# (c) 2020 Aaron Taylor <ataylor at subgeniuskitty dot com> #
# See LICENSE.txt file for copyright and license details. #
#############################################################
####################################################################################################
# GNU Executables & Flags
CC_FLAGS
= -c
-Wall
-Wno-unused-function
-O0
-ffreestanding
-fomit-frame-pointer
-fno-builtin-alloca
-std
=c99
LD_FLAGS
= -T pdp11.
ld --entry _start
OC_FLAGS
= --only-section
=.text
--output-target binary
####################################################################################################
# Physical serial port connected to a PDP-11 for transfering program into memory.
# Commands for converting raw binary into SIMH or real PDP compatible formats.
# Commands for running the SIMH PDP-11 simulation.
####################################################################################################
$(AS
) $(AS_FLAGS
) -o init.o init.s
$(AS
) $(AS_FLAGS
) -o pdp11_inthandler.o pdp11
/interrupt_handler.s
$(CC
) $(CC_FLAGS
) -o pdp11_interrupt.o pdp11
/pdp11_interrupt.c
$(CC
) $(CC_FLAGS
) -o pdp11_slu.o pdp11
/pdp11_slu.c
$(CC
) $(CC_FLAGS
) -o pdp11_mmu.o pdp11
/pdp11_mmu.c
$(CC
) $(CC_FLAGS
) -o pdp11.o pdp11
/pdp11.c
##############################################
# Insert your program's build commands here. #
$(CC
) $(CC_FLAGS
) -o hello.o hello.c
##############################################
$(LD
) $(LD_FLAGS
) init.o pdp11_inthandler.o pdp11_interrupt.o pdp11_slu.o pdp11_mmu.o pdp11.o \
@
rm -rf
*.o
*.out
*.pdp11
*.bin
*.core
$(OC
) $(OC_FLAGS
) program.out program.bin
$(SIM_LOAD
) -i program.bin
-o program.pdp11
-a
01000
$(OC
) $(OC_FLAGS
) program.out program.bin
$(PDP_LOAD
) -i program.bin
-o
$(SERIAL_PORT
)