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