Subversion Repositories HelenOS

Rev

Rev 3803 | Go to most recent revision | 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
3882 decky 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)
3882 decky 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)
30
	$(OBJDUMP) -d $< >$@
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 $@