Created
March 26, 2015 14:02
-
-
Save naohaq/7b561471101509306db9 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/make -f | |
CFLAGS = -O3 | |
.PHONY: all clean | |
all: main | |
main: main.c hoge.o | |
cc $(CFLAGS) -o $@ $^ | |
main.c: | |
@echo '#include <stdint.h>' > $@ | |
@echo '#include <stdio.h>' >> $@ | |
@echo 'extern uint32_t hoge;' >> $@ | |
@echo 'main() { printf("%08x\\n",hoge); }' >> $@ | |
hoge.o: hoge.c | |
hoge.c: | |
@echo 'int hoge(int x) { return x+3; }' > $@ | |
clean: | |
rm -f hoge.c hoge.o main.c main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment