Skip to content

Instantly share code, notes, and snippets.

@KentaKudo
Last active March 8, 2019 16:09
Show Gist options
  • Save KentaKudo/8ae26cc837cf39100805f656b6146094 to your computer and use it in GitHub Desktop.
Save KentaKudo/8ae26cc837cf39100805f656b6146094 to your computer and use it in GitHub Desktop.
A snippet for the Makefile of the C compiler on x86_64 in working with macOS
WORKDIR := /usr/src/mycc
mycc: mycc.c
@docker run --rm -v ${PWD}:${WORKDIR} -w ${WORKDIR} gcc:8.3 gcc -o mycc mycc.c
.PHONY: test
test: mycc
@docker run --rm -v ${PWD}:${WORKDIR} -w ${WORKDIR} gcc:8.3 ./test.sh
.PHONY: clean
clean:
@rm -f mycc *.o *~ tmp*
.PHONY: debug
debug:
@docker run --rm -it -v ${PWD}:${WORKDIR} -w ${WORKDIR} gcc:8.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment