Rev 3924 | Rev 3926 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3924 | Rev 3925 | ||
---|---|---|---|
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 | LIBC_PREFIX = ../../lib/libc |
32 | LIBC_PREFIX = ../../lib/libc |
33 | SOFTINT_PREFIX = ../../lib/softint |
33 | SOFTINT_PREFIX = ../../lib/softint |
34 | 34 | ||
35 | include $(LIBC_PREFIX)/Makefile.toolchain |
35 | include $(LIBC_PREFIX)/Makefile.toolchain |
36 | 36 | ||
37 | CFLAGS += -Iinclude -I../libadt/include |
37 | CFLAGS += -Iinclude -I../libadt/include |
38 | 38 | ||
39 | LIBS = $(LIBC_PREFIX)/libc.a |
39 | LIBS = $(LIBC_PREFIX)/libc.a |
40 | 40 | ||
41 | ## Sources |
41 | ## Sources |
42 | # |
42 | # |
43 | 43 | ||
44 | OUTPUT = kbd |
44 | OUTPUT = kbd |
45 | GENERIC_SOURCES = \ |
45 | GENERIC_SOURCES = \ |
46 | generic/kbd.c \ |
46 | generic/kbd.c \ |
47 | generic/key_buffer.c |
47 | generic/key_buffer.c |
48 | 48 | ||
49 | ARCH_SOURCES = |
49 | ARCH_SOURCES = |
50 | GENARCH_SOURCES = |
50 | GENARCH_SOURCES = |
51 | 51 | ||
52 | ifeq ($(KBD_LAYOUT), us_qwerty) |
52 | ifeq ($(KBD_LAYOUT), us_qwerty) |
53 | GENARCH_SOURCES += layout/us_qwerty.c |
53 | GENARCH_SOURCES += layout/us_qwerty.c |
54 | endif |
54 | endif |
55 | ifeq ($(KBD_LAYOUT), us_dvorak) |
55 | ifeq ($(KBD_LAYOUT), us_dvorak) |
56 | GENARCH_SOURCES += layout/us_dvorak.c |
56 | GENARCH_SOURCES += layout/us_dvorak.c |
57 | endif |
57 | endif |
58 | 58 | ||
59 | ifeq ($(UARCH), amd64) |
59 | ifeq ($(UARCH), amd64) |
60 | GENARCH_SOURCES += \ |
60 | GENARCH_SOURCES += \ |
61 | port/i8042.c \ |
61 | port/i8042.c \ |
62 | ctl/pc.c |
62 | ctl/pc.c |
63 | endif |
63 | endif |
64 | ifeq ($(UARCH), arm32) |
64 | ifeq ($(UARCH), arm32) |
65 | GENARCH_SOURCES += \ |
65 | GENARCH_SOURCES += \ |
66 | port/gxemul.c |
66 | port/gxemul.c |
67 | ifeq ($(CONFIG_FB), y) |
67 | ifeq ($(CONFIG_FB), y) |
68 | GENARCH_SOURCES += \ |
68 | GENARCH_SOURCES += \ |
69 | ctl/gxe_fb.c |
69 | ctl/gxe_fb.c |
70 | else |
70 | else |
71 | GENARCH_SOURCES += \ |
71 | GENARCH_SOURCES += \ |
72 | ctl/stty.c |
72 | ctl/stty.c |
73 | endif |
73 | endif |
74 | endif |
74 | endif |
75 | ifeq ($(UARCH), ia32) |
75 | ifeq ($(UARCH), ia32) |
76 | GENARCH_SOURCES += \ |
76 | GENARCH_SOURCES += \ |
77 | port/i8042.c \ |
77 | port/i8042.c \ |
78 | ctl/pc.c |
78 | ctl/pc.c |
79 | endif |
79 | endif |
80 | ifeq ($(UARCH), ia64) |
80 | ifeq ($(UARCH), ia64) |
81 | GENARCH_SOURCES += \ |
81 | GENARCH_SOURCES += \ |
82 | port/dummy.c \ |
82 | port/dummy.c \ |
83 | ctl/stty.c |
83 | ctl/stty.c |
84 | endif |
84 | endif |
85 | ifeq ($(MACHINE), msim) |
85 | ifeq ($(MACHINE), msim) |
86 | GENARCH_SOURCES += \ |
86 | GENARCH_SOURCES += \ |
87 | port/msim.c \ |
87 | port/msim.c \ |
88 | ctl/stty.c |
88 | ctl/stty.c |
89 | endif |
89 | endif |
90 | ifeq ($(MACHINE), lgxemul) |
90 | ifeq ($(MACHINE), lgxemul) |
91 | GENARCH_SOURCES += \ |
91 | GENARCH_SOURCES += \ |
92 | port/gxemul.c |
92 | port/gxemul.c |
93 | ifeq ($(CONFIG_FB), y) |
93 | ifeq ($(CONFIG_FB), y) |
94 | GENARCH_SOURCES += \ |
94 | GENARCH_SOURCES += \ |
95 | ctl/gxe_fb.c |
95 | ctl/gxe_fb.c |
96 | else |
96 | else |
97 | GENARCH_SOURCES += \ |
97 | GENARCH_SOURCES += \ |
98 | ctl/stty.c |
98 | ctl/stty.c |
99 | endif |
99 | endif |
100 | endif |
100 | endif |
101 | ifeq ($(MACHINE), bgxemul) |
101 | ifeq ($(MACHINE), bgxemul) |
102 | GENARCH_SOURCES += \ |
102 | GENARCH_SOURCES += \ |
103 | port/gxemul.c \ |
103 | port/gxemul.c \ |
104 | ctl/stty.c |
104 | ctl/stty.c |
105 | endif |
105 | endif |
106 | ifeq ($(UARCH), ppc32) |
106 | ifeq ($(UARCH), ppc32) |
107 | GENARCH_SOURCES += \ |
107 | GENARCH_SOURCES += \ |
108 | port/dummy.c \ |
108 | port/dummy.c \ |
109 | ctl/stty.c |
109 | ctl/stty.c |
110 | endif |
110 | endif |
111 | ifeq ($(UARCH), sparc64) |
111 | ifeq ($(UARCH), sparc64) |
112 | GENARCH_SOURCES += \ |
112 | GENARCH_SOURCES += \ |
113 | port/z8350.c \ |
113 | port/z8530.c \ |
114 | ctl/sun.c |
114 | ctl/sun.c |
115 | endif |
115 | endif |
116 | 116 | ||
117 | # ifeq ($(UARCH), ia32) |
- | |
118 | # ARCH_SOURCES += \ |
- | |
119 | # arch/$(UARCH)/src/mouse.c \ |
- | |
120 | # arch/$(UARCH)/src/scanc.c |
- | |
121 | # GENARCH_SOURCES = \ |
- | |
122 | # genarch/src/kbd.c |
- | |
123 | # CFLAGS += -DMOUSE_ENABLED |
- | |
124 | # endif |
- | |
125 | # ifeq ($(UARCH), ia64) |
- | |
126 | # ARCH_SOURCES += \ |
- | |
127 | # arch/$(UARCH)/src/mouse.c \ |
- | |
128 | # arch/$(UARCH)/src/scanc.c \ |
- | |
129 | # arch/$(UARCH)/src/lkbd.c |
- | |
130 | # GENARCH_SOURCES = \ |
- | |
131 | # genarch/src/kbd.c |
- | |
132 | # CFLAGS += -DMOUSE_ENABLED |
- | |
133 | # endif |
- | |
134 | # ifeq ($(UARCH), amd64) |
- | |
135 | # ARCH_SOURCES += \ |
- | |
136 | # arch/$(UARCH)/src/mouse.c \ |
- | |
137 | # arch/$(UARCH)/src/scanc.c |
- | |
138 | # GENARCH_SOURCES = \ |
- | |
139 | # genarch/src/kbd.c |
- | |
140 | # CFLAGS += -DMOUSE_ENABLED |
- | |
141 | # endif |
- | |
142 | # ifeq ($(UARCH), sparc64) |
- | |
143 | # ARCH_SOURCES += \ |
- | |
144 | # arch/$(UARCH)/src/scanc.c \ |
- | |
145 | # arch/$(UARCH)/src/sgcn.c |
- | |
146 | # GENARCH_SOURCES = \ |
- | |
147 | # genarch/src/kbd.c \ |
- | |
148 | # genarch/src/nofb.c |
- | |
149 | # endif |
- | |
150 | # ifeq ($(UARCH), arm32) |
- | |
151 | # ARCH_SOURCES += \ |
- | |
152 | # arch/$(UARCH)/src/kbd_gxemul.c |
- | |
153 | # endif |
- | |
154 | # ifeq ($(UARCH), mips32) |
- | |
155 | # GENARCH_SOURCES += \ |
- | |
156 | # genarch/src/nofb.c |
- | |
157 | # endif |
- | |
158 | # ifeq ($(UARCH), mips32eb) |
- | |
159 | # GENARCH_SOURCES += \ |
- | |
160 | # genarch/src/nofb.c |
- | |
161 | # endif |
- | |
162 | - | ||
163 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
117 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
164 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
118 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
165 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
119 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
166 | 120 | ||
167 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
121 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
168 | 122 | ||
169 | .PHONY: all clean depend disasm links |
123 | .PHONY: all clean depend disasm links |
170 | 124 | ||
171 | all: links $(OUTPUT) $(OUTPUT).disasm |
125 | all: links $(OUTPUT) $(OUTPUT).disasm |
172 | 126 | ||
173 | -include Makefile.depend |
127 | -include Makefile.depend |
174 | 128 | ||
175 | links: |
129 | links: |
176 | ln -sfn ../arch/$(UARCH)/include include/arch |
130 | ln -sfn ../arch/$(UARCH)/include include/arch |
177 | ln -sfn ../genarch/include include/genarch |
131 | ln -sfn ../genarch/include include/genarch |
178 | 132 | ||
179 | clean: |
133 | clean: |
180 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
134 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
181 | 135 | ||
182 | depend: |
136 | depend: |
183 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
137 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
184 | 138 | ||
185 | $(OUTPUT): $(OBJECTS) $(LIBS) |
139 | $(OUTPUT): $(OBJECTS) $(LIBS) |
186 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
140 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
187 | 141 | ||
188 | disasm: $(OUTPUT).disasm |
142 | disasm: $(OUTPUT).disasm |
189 | 143 | ||
190 | $(OUTPUT).disasm: $(OUTPUT) |
144 | $(OUTPUT).disasm: $(OUTPUT) |
191 | $(OBJDUMP) -d $< >$@ |
145 | $(OBJDUMP) -d $< >$@ |
192 | 146 | ||
193 | %.o: %.S |
147 | %.o: %.S |
194 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
148 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
195 | 149 | ||
196 | %.o: %.s |
150 | %.o: %.s |
197 | $(AS) $(AFLAGS) $< -o $@ |
151 | $(AS) $(AFLAGS) $< -o $@ |
198 | 152 | ||
199 | %.o: %.c |
153 | %.o: %.c |
200 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
154 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
201 | 155 |