Created
November 1, 2012 21:01
-
-
Save jdiez17/3996515 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DT_PATH=$(HOME)/DCPUToolchain | |
CC=$(DT_PATH)/dtcc/dtcc | |
ASM=$(DT_PATH)/dtasm/dtasm | |
LD=$(DT_PATH)/dtld/dtld | |
EMU=$(DT_PATH)/dtemu/dtemu | |
STDLIB=$(DT_PATH)/stdlib-c/stdlib.dlib16 | |
KERNEL=$(DT_PATH)/kernel/stubsys.dkrn16 | |
JUMP=$(DT_PATH)/kernel/stubsys.djmp16 | |
INCLUDE=${DT_PATH}/stdlib-c/include | |
TARGET=main | |
all: $(TARGET).dcpu16 | |
run: $(TARGET).dcpu16 | |
# Emulate the final output | |
$(EMU) $(TARGET).dcpu16 | |
$(TARGET).oa: $(TARGET).c | |
# -v means verbose, -o is the output file, -I sets the include path | |
$(CC) -v -o $@ -I $(INCLUDE) $(TARGET).c | |
$(TARGET).o: $(TARGET).oa | |
# -i generates intermediate code, -o is the output file, -s generates symbol files | |
$(ASM) -i -o$@ $(TARGET).oa -s [email protected] | |
$(TARGET).dcpu16: $(TARGET).o | |
# link the intermediate file with stubsys, the minimal kernel | |
$(LD) -k $(KERNEL) --jumplist $(JUMP) -o $@ $(STDLIB) $(TARGET).o | |
clean: | |
rm -fv *.bin *.asm *.o *.oa *.cdasm *.dcpu16 *.dasm16 pp.* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment