]>
Commit | Line | Data |
---|---|---|
1 | CC=./jwcc.lua | |
2 | AS=blarg-elf-as | |
3 | ||
4 | EXAMPLES=examples/easytest.bin examples/fact.bin examples/fib.bin | |
5 | ||
6 | all: sim/blargcpu2 $(EXAMPLES) | |
7 | ||
8 | STAMP_jwcc: jwcc.lua lib/backend/default.lua lib/parser/default.lua lib/tokenizer/default.lua | |
9 | @echo "jwcc inputs changed; rebuilding all C programs" | |
10 | @touch STAMP_jwcc | |
11 | ||
12 | sim/blargcpu2: sim/blargcpu2.c | |
13 | gcc -O3 -o sim/blargcpu2 sim/blargcpu2.c -lreadline `sdl-config --cflags --libs` | |
14 | ||
15 | %.o: %.c STAMP_jwcc | |
16 | $(CC) -c -o $@ $< | |
17 | ||
18 | %.elf: %.o examples/libblarg.o examples/blargcpu.ld | |
19 | blarg-elf-ld -T examples/blargcpu.ld -o $@ $< examples/libblarg.o | |
20 | ||
21 | %.bin: %.elf | |
22 | blarg-elf-objcopy -Obinary $< $@ | |
23 |