Rev 4055 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4055 | Rev 4420 | ||
---|---|---|---|
1 | LIBC_PREFIX = ../../lib/libc |
1 | LIBC_PREFIX = ../../lib/libc |
2 | SOFTINT_PREFIX = ../../lib/softint |
2 | SOFTINT_PREFIX = ../../lib/softint |
3 | 3 | ||
4 | include $(LIBC_PREFIX)/Makefile.toolchain |
4 | include $(LIBC_PREFIX)/Makefile.toolchain |
5 | 5 | ||
6 | LIBS = $(LIBC_PREFIX)/libc.a |
6 | LIBS = $(LIBC_PREFIX)/libc.a |
7 | 7 | ||
8 | OUTPUT = tetris |
8 | OUTPUT = tetris |
9 | SOURCES = shapes.c scores.c input.c tetris.c screen.c |
9 | SOURCES = shapes.c scores.c input.c tetris.c screen.c |
10 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
10 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
11 | 11 | ||
12 | .PHONY: all clean depend disasm |
12 | .PHONY: all clean depend disasm |
13 | 13 | ||
14 | all: $(OUTPUT) $(OUTPUT).disasm |
14 | all: $(OUTPUT) $(OUTPUT).disasm |
15 | 15 | ||
16 | -include Makefile.depend |
16 | -include Makefile.depend |
17 | 17 | ||
18 | depend: |
18 | depend: |
19 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
19 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
20 | 20 | ||
21 | $(OUTPUT): $(OBJECTS) $(LIBS) |
21 | $(OUTPUT): $(OBJECTS) $(LIBS) |
22 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
22 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
23 | 23 | ||
24 | clean: |
24 | clean: |
25 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o |
25 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o |
26 | 26 | ||
27 | disasm: $(OUTPUT).disasm |
27 | disasm: $(OUTPUT).disasm |
28 | 28 | ||
29 | $(OUTPUT).disasm: $(OUTPUT) |
29 | $(OUTPUT).disasm: $(OUTPUT) |
30 | $(OBJDUMP) -d $< >$@ |
30 | $(OBJDUMP) -d $< > $@ |
31 | 31 | ||
32 | %.o: %.S |
32 | %.o: %.S |
33 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
33 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
34 | 34 | ||
35 | %.o: %.s |
35 | %.o: %.s |
36 | $(AS) $(AFLAGS) $< -o $@ |
36 | $(AS) $(AFLAGS) $< -o $@ |
37 | 37 | ||
38 | %.o: %.c |
38 | %.o: %.c |
39 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
39 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
40 | 40 |