Skip to content

Instantly share code, notes, and snippets.

@qguv
Created June 26, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qguv/8ca67755fd52bca24d83b9a77750d41f to your computer and use it in GitHub Desktop.
Save qguv/8ca67755fd52bca24d83b9a77750d41f to your computer and use it in GitHub Desktop.
Makefile for ras52/bootstrap (WIP)
.DEFAULT_GOAL := stage-3/ld
ELF_BIN := stage-1/elfify
BIN := stage-1/unhexl stage-2/as stage-3/ld stage-3/test1 stage-3/test2 stage-3/test3
stage-0/_unhex: stage-0/unhex.x
$(info #1)
printf $$(printf '\\x%s' $$(<$<)) >$@
chmod u+x $@
stage-0/unhex: stage-0/unhex.x stage-0/_unhex
$(info #2)
stage-0/_unhex <$< >$@
chmod u+x $@
%.ts: %.ts.x stage-0/unhex
$(info #3)
stage-0/unhex <$< >$@
$(ELF_BIN): %: %.x stage-0/unhex
$(info #4)
stage-0/unhex <$< >$@
chmod u+x $@
$(BIN): %: %.ts stage-1/elfify
$(info #5)
stage-1/elfify $< >$@
chmod u+x $@
%.ts: %.ts.xl stage-1/unhexl
$(info #6)
stage-1/unhexl <$< >$@
%.ts: %.s stage-2/as
$(info #7)
stage-2/as $< > $@
.PHONY: clean
clean:
rm -f stage-0/_unhex stage-0/unhex $(ELF_BIN) stage-1/unhexl.ts $(BIN) stage-2/as.ts
.DELETE_ON_ERROR:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment