Subversion Repositories HelenOS

Rev

Rev 3425 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3597 svoboda 1
include ../../Makefile.config
2
 
2479 jermar 3
LIBC_PREFIX = ../../lib/libc
4
SOFTINT_PREFIX = ../../lib/softint
1449 palkovsky 5
include $(LIBC_PREFIX)/Makefile.toolchain
1419 jermar 6
 
1449 palkovsky 7
LIBS = $(LIBC_PREFIX)/libc.a
1419 jermar 8
 
1449 palkovsky 9
OUTPUT = tetris
1466 palkovsky 10
SOURCES = shapes.c scores.c input.c tetris.c screen.c
1449 palkovsky 11
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
1419 jermar 12
 
1449 palkovsky 13
.PHONY: all clean depend disasm
14
 
3425 svoboda 15
all: $(OUTPUT) $(OUTPUT).disasm
1449 palkovsky 16
 
17
-include Makefile.depend
18
 
19
depend:
20
	$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
21
 
22
$(OUTPUT): $(OBJECTS) $(LIBS)
23
	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
24
 
25
clean:
26
	-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o
27
 
3425 svoboda 28
disasm: $(OUTPUT).disasm
29
 
30
$(OUTPUT).disasm: $(OUTPUT)
31
	$(OBJDUMP) -d $< >$@
32
 
1449 palkovsky 33
%.o: %.S
34
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
35
 
36
%.o: %.s
37
	$(AS) $(AFLAGS) $< -o $@
38
 
39
%.o: %.c
40
	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@