Updated hello.c from putch() to printf().
[pdp11-modern-c] / Makefile
#############################################################
# (c) 2020 Aaron Taylor <ataylor at subgeniuskitty dot com> #
# See LICENSE.txt file for copyright and license details. #
#############################################################
####################################################################################################
# GNU Executables & Flags
CC = pdp11-aout-gcc
LD = pdp11-aout-ld
AS = pdp11-aout-as
OC = pdp11-aout-objcopy
OD = pdp11-aout-objdump
CC_FLAGS = -c -Wall -Wno-unused-function -O0 -ffreestanding -fomit-frame-pointer -fno-builtin-alloca -std=c99
LD_FLAGS = -T pdp11.ld --entry _start
AS_FLAGS =
OC_FLAGS = --only-section=.text --output-target binary
####################################################################################################
# Misc Configuration
# Physical serial port connected to a PDP-11 for transfering program into memory.
SERIAL_PORT = /dev/cuau0
# Commands for converting raw binary into SIMH or real PDP compatible formats.
SIM_LOAD = bin2load
PDP_LOAD = bin2pdp
# Commands for running the SIMH PDP-11 simulation.
SIMH_CMD = pdp11
SIMH_CFG = simh.conf
####################################################################################################
# Targets
all: aout
aout:
$(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 \
hello.o -o program.out
clean:
@rm -rf *.o *.out *.pdp11 *.bin *.core
sim: aout
$(OC) $(OC_FLAGS) program.out program.bin
$(SIM_LOAD) -i program.bin -o program.pdp11 -a 01000
$(SIMH_CMD) $(SIMH_CFG)
pdp: aout
$(OC) $(OC_FLAGS) program.out program.bin
$(PDP_LOAD) -i program.bin -o $(SERIAL_PORT)
examine: aout
@$(OD) -d program.out