Subversion Repositories HelenOS

Rev

Rev 2911 | Rev 2924 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2911 Rev 2923
Line 1... Line 1...
1
#
1
#
2
# Copyright (c) 2005 Martin Decky
2
# Copyright (c) 2005 Martin Decky
-
 
3
# Copyright (c) 2008 Jiri Svoboda
3
# All rights reserved.
4
# All rights reserved.
4
#
5
#
5
# Redistribution and use in source and binary forms, with or without
6
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# modification, are permitted provided that the following conditions
7
# are met:
8
# are met:
Line 30... Line 31...
30
#
31
#
31
 
32
 
32
LIBC_PREFIX = ../../lib/libc
33
LIBC_PREFIX = ../../lib/libc
33
SOFTINT_PREFIX = ../../lib/softint
34
SOFTINT_PREFIX = ../../lib/softint
34
include $(LIBC_PREFIX)/Makefile.toolchain
35
include $(LIBC_PREFIX)/Makefile.toolchain
-
 
36
include arch/$(ARCH)/Makefile.inc
35
 
37
 
36
CFLAGS += -I../../srv/kbd/include
38
CFLAGS += -I../../srv/kbd/include
37
 
39
 
38
LIBS = $(LIBC_PREFIX)/libc.a
40
LIBS = $(LIBC_PREFIX)/libc.a
39
 
41
 
40
## Sources
42
## Sources
41
#
43
#
42
 
44
 
43
OUTPUT = debug
45
OUTPUT = debug
44
SOURCES = cmd.c \
46
GENERIC_SOURCES = cmd.c \
45
	main.c
47
	main.c
46
 
48
 
-
 
49
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
47
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
50
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
48
 
51
 
49
.PHONY: all clean depend disasm
52
.PHONY: all clean depend disasm inc
50
 
53
 
51
all: $(OUTPUT) disasm
54
all: inc $(OUTPUT) disasm
-
 
55
 
-
 
56
inc:
-
 
57
	ln -sfn ../arch/$(ARCH)/include include/arch
52
 
58
 
53
-include Makefile.depend
59
-include Makefile.depend
54
 
60
 
55
clean:
61
clean:
56
	-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend
62
	-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend
57
 
63
 
58
depend:
64
depend:
59
	$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
65
	$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
60
 
66
 
61
$(OUTPUT): $(OBJECTS) $(LIBS)
67
$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS)
62
	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
68
	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
63
 
69
 
64
disasm:
70
disasm:
65
	$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
71
	$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
66
 
72
 
67
%.o: %.S
73
%.o: %.S