Rev 3803 | Rev 3924 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3803 | Rev 3882 | ||
---|---|---|---|
1 | # |
1 | # |
2 | # Copyright (c) 2005 Martin Decky |
2 | # Copyright (c) 2005 Martin Decky |
3 | # All rights reserved. |
3 | # All rights reserved. |
4 | # |
4 | # |
5 | # Redistribution and use in source and binary forms, with or without |
5 | # Redistribution and use in source and binary forms, with or without |
6 | # modification, are permitted provided that the following conditions |
6 | # modification, are permitted provided that the following conditions |
7 | # are met: |
7 | # are met: |
8 | # |
8 | # |
9 | # - Redistributions of source code must retain the above copyright |
9 | # - Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. |
10 | # notice, this list of conditions and the following disclaimer. |
11 | # - Redistributions in binary form must reproduce the above copyright |
11 | # - Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the |
12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. |
13 | # documentation and/or other materials provided with the distribution. |
14 | # - The name of the author may not be used to endorse or promote products |
14 | # - The name of the author may not be used to endorse or promote products |
15 | # derived from this software without specific prior written permission. |
15 | # derived from this software without specific prior written permission. |
16 | # |
16 | # |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | ## Setup toolchain |
29 | ## Setup toolchain |
30 | # |
30 | # |
31 | 31 | ||
32 | -include ../../../Makefile.config |
- | |
33 | - | ||
34 | LIBC_PREFIX = ../../lib/libc |
32 | LIBC_PREFIX = ../../lib/libc |
35 | SOFTINT_PREFIX = ../../lib/softint |
33 | SOFTINT_PREFIX = ../../lib/softint |
- | 34 | ||
36 | include $(LIBC_PREFIX)/Makefile.toolchain |
35 | include $(LIBC_PREFIX)/Makefile.toolchain |
37 | 36 | ||
38 | CFLAGS += -Iinclude -I../libadt/include |
37 | CFLAGS += -Iinclude -I../libadt/include |
39 | 38 | ||
40 | LIBS = $(LIBC_PREFIX)/libc.a |
39 | LIBS = $(LIBC_PREFIX)/libc.a |
41 | 40 | ||
42 | ## Sources |
41 | ## Sources |
43 | # |
42 | # |
44 | 43 | ||
45 | OUTPUT = kbd |
44 | OUTPUT = kbd |
46 | GENERIC_SOURCES = \ |
45 | GENERIC_SOURCES = \ |
47 | generic/kbd.c \ |
46 | generic/kbd.c \ |
48 | generic/key_buffer.c |
47 | generic/key_buffer.c |
49 | 48 | ||
50 | ARCH_SOURCES = \ |
49 | ARCH_SOURCES = \ |
51 | arch/$(ARCH)/src/kbd.c |
50 | arch/$(UARCH)/src/kbd.c |
52 | 51 | ||
53 | ifeq ($(ARCH), ia32) |
52 | ifeq ($(UARCH), ia32) |
54 | ARCH_SOURCES += \ |
53 | ARCH_SOURCES += \ |
55 | arch/$(ARCH)/src/mouse.c \ |
54 | arch/$(UARCH)/src/mouse.c \ |
56 | arch/$(ARCH)/src/scanc.c |
55 | arch/$(UARCH)/src/scanc.c |
57 | GENARCH_SOURCES = \ |
56 | GENARCH_SOURCES = \ |
58 | genarch/src/kbd.c |
57 | genarch/src/kbd.c |
59 | CFLAGS += -DMOUSE_ENABLED |
58 | CFLAGS += -DMOUSE_ENABLED |
60 | endif |
59 | endif |
61 | ifeq ($(ARCH), ia64) |
60 | ifeq ($(UARCH), ia64) |
62 | ARCH_SOURCES += \ |
61 | ARCH_SOURCES += \ |
63 | arch/$(ARCH)/src/mouse.c \ |
62 | arch/$(UARCH)/src/mouse.c \ |
64 | arch/$(ARCH)/src/scanc.c \ |
63 | arch/$(UARCH)/src/scanc.c \ |
65 | arch/$(ARCH)/src/lkbd.c |
64 | arch/$(UARCH)/src/lkbd.c |
66 | GENARCH_SOURCES = \ |
65 | GENARCH_SOURCES = \ |
67 | genarch/src/kbd.c |
66 | genarch/src/kbd.c |
68 | CFLAGS += -DMOUSE_ENABLED |
67 | CFLAGS += -DMOUSE_ENABLED |
69 | endif |
68 | endif |
70 | ifeq ($(ARCH), amd64) |
69 | ifeq ($(UARCH), amd64) |
71 | ARCH_SOURCES += \ |
70 | ARCH_SOURCES += \ |
72 | arch/$(ARCH)/src/mouse.c \ |
71 | arch/$(UARCH)/src/mouse.c \ |
73 | arch/$(ARCH)/src/scanc.c |
72 | arch/$(UARCH)/src/scanc.c |
74 | GENARCH_SOURCES = \ |
73 | GENARCH_SOURCES = \ |
75 | genarch/src/kbd.c |
74 | genarch/src/kbd.c |
76 | CFLAGS += -DMOUSE_ENABLED |
75 | CFLAGS += -DMOUSE_ENABLED |
77 | endif |
76 | endif |
78 | ifeq ($(ARCH), sparc64) |
77 | ifeq ($(UARCH), sparc64) |
79 | ARCH_SOURCES += \ |
78 | ARCH_SOURCES += \ |
80 | arch/$(ARCH)/src/scanc.c \ |
79 | arch/$(UARCH)/src/scanc.c \ |
81 | arch/$(ARCH)/src/sgcn.c |
80 | arch/$(UARCH)/src/sgcn.c |
82 | GENARCH_SOURCES = \ |
81 | GENARCH_SOURCES = \ |
83 | genarch/src/kbd.c \ |
82 | genarch/src/kbd.c \ |
84 | genarch/src/nofb.c |
83 | genarch/src/nofb.c |
85 | endif |
84 | endif |
86 | ifeq ($(ARCH), arm32) |
85 | ifeq ($(UARCH), arm32) |
87 | ARCH_SOURCES += \ |
86 | ARCH_SOURCES += \ |
88 | arch/$(ARCH)/src/kbd_gxemul.c |
87 | arch/$(UARCH)/src/kbd_gxemul.c |
89 | endif |
88 | endif |
90 | ifeq ($(ARCH), mips32) |
89 | ifeq ($(UARCH), mips32) |
91 | GENARCH_SOURCES += \ |
90 | GENARCH_SOURCES += \ |
92 | genarch/src/nofb.c |
91 | genarch/src/nofb.c |
93 | endif |
92 | endif |
94 | ifeq ($(ARCH), mips32eb) |
93 | ifeq ($(UARCH), mips32eb) |
95 | GENARCH_SOURCES += \ |
94 | GENARCH_SOURCES += \ |
96 | genarch/src/nofb.c |
95 | genarch/src/nofb.c |
97 | endif |
96 | endif |
98 | 97 | ||
99 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
98 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
100 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
99 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
101 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
100 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
102 | 101 | ||
103 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
102 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
104 | 103 | ||
105 | .PHONY: all clean depend disasm links |
104 | .PHONY: all clean depend disasm links |
106 | 105 | ||
107 | all: links $(OUTPUT) $(OUTPUT).disasm |
106 | all: links $(OUTPUT) $(OUTPUT).disasm |
108 | 107 | ||
109 | -include Makefile.depend |
108 | -include Makefile.depend |
110 | 109 | ||
111 | links: |
110 | links: |
112 | ln -sfn ../arch/$(ARCH)/include include/arch |
111 | ln -sfn ../arch/$(UARCH)/include include/arch |
113 | ln -sfn ../genarch/include include/genarch |
112 | ln -sfn ../genarch/include include/genarch |
114 | 113 | ||
115 | clean: |
114 | clean: |
116 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
115 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
117 | 116 | ||
118 | depend: |
117 | depend: |
119 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
118 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
120 | 119 | ||
121 | $(OUTPUT): $(OBJECTS) $(LIBS) |
120 | $(OUTPUT): $(OBJECTS) $(LIBS) |
122 | $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
121 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
123 | 122 | ||
124 | disasm: $(OUTPUT).disasm |
123 | disasm: $(OUTPUT).disasm |
125 | 124 | ||
126 | $(OUTPUT).disasm: $(OUTPUT) |
125 | $(OUTPUT).disasm: $(OUTPUT) |
127 | $(OBJDUMP) -d $< >$@ |
126 | $(OBJDUMP) -d $< >$@ |
128 | 127 | ||
129 | %.o: %.S |
128 | %.o: %.S |
130 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
129 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
131 | 130 | ||
132 | %.o: %.s |
131 | %.o: %.s |
133 | $(AS) $(AFLAGS) $< -o $@ |
132 | $(AS) $(AFLAGS) $< -o $@ |
134 | 133 | ||
135 | %.o: %.c |
134 | %.o: %.c |
136 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
135 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
137 | 136 |