Subversion Repositories HelenOS

Rev

Rev 4153 | Details | Compare with Previous | Last modification | View Log | RSS feed

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