Rev 4284 | Rev 4413 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4284 | Rev 4334 | ||
---|---|---|---|
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 | genarch/gsp.c \ |
47 | genarch/gsp.c \ |
48 | genarch/stroke.c \ |
48 | genarch/stroke.c \ |
49 | generic/key_buffer.c |
49 | generic/key_buffer.c |
50 | 50 | ||
51 | ARCH_SOURCES = |
51 | ARCH_SOURCES = |
52 | GENARCH_SOURCES = \ |
52 | GENARCH_SOURCES = \ |
53 | layout/cz.c \ |
53 | layout/cz.c \ |
54 | layout/us_qwerty.c \ |
54 | layout/us_qwerty.c \ |
55 | layout/us_dvorak.c |
55 | layout/us_dvorak.c |
56 | 56 | ||
57 | ifeq ($(UARCH), amd64) |
57 | ifeq ($(UARCH), amd64) |
58 | GENARCH_SOURCES += \ |
58 | GENARCH_SOURCES += \ |
59 | port/i8042.c \ |
59 | port/i8042.c \ |
60 | ctl/pc.c |
60 | ctl/pc.c |
61 | endif |
61 | endif |
62 | 62 | ||
63 | ifeq ($(UARCH), arm32) |
63 | ifeq ($(UARCH), arm32) |
64 | GENARCH_SOURCES += \ |
64 | GENARCH_SOURCES += \ |
65 | port/gxemul.c |
65 | port/gxemul.c |
66 | 66 | ||
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 | 75 | ||
76 | ifeq ($(UARCH), ia32) |
76 | ifeq ($(UARCH), ia32) |
77 | GENARCH_SOURCES += \ |
77 | GENARCH_SOURCES += \ |
78 | port/i8042.c \ |
78 | port/i8042.c \ |
79 | ctl/pc.c |
79 | ctl/pc.c |
80 | endif |
80 | endif |
81 | 81 | ||
82 | ifeq ($(MACHINE), i460GX) |
82 | ifeq ($(MACHINE), i460GX) |
83 | GENARCH_SOURCES += \ |
83 | GENARCH_SOURCES += \ |
84 | port/i8042.c \ |
84 | port/i8042.c \ |
85 | ctl/pc.c |
85 | ctl/pc.c |
86 | endif |
86 | endif |
87 | 87 | ||
88 | ifeq ($(MACHINE), ski) |
88 | ifeq ($(MACHINE), ski) |
89 | GENARCH_SOURCES += \ |
89 | GENARCH_SOURCES += \ |
90 | port/ski.c \ |
90 | port/ski.c \ |
91 | ctl/stty.c |
91 | ctl/stty.c |
92 | endif |
92 | endif |
93 | 93 | ||
94 | ifeq ($(MACHINE), msim) |
94 | ifeq ($(MACHINE), msim) |
95 | GENARCH_SOURCES += \ |
95 | GENARCH_SOURCES += \ |
96 | port/msim.c \ |
96 | port/msim.c \ |
97 | ctl/stty.c |
97 | ctl/stty.c |
98 | endif |
98 | endif |
99 | 99 | ||
100 | ifeq ($(MACHINE), lgxemul) |
100 | ifeq ($(MACHINE), lgxemul) |
101 | GENARCH_SOURCES += \ |
101 | GENARCH_SOURCES += \ |
102 | port/gxemul.c |
102 | port/gxemul.c |
103 | 103 | ||
104 | ifeq ($(CONFIG_FB), y) |
104 | ifeq ($(CONFIG_FB), y) |
105 | GENARCH_SOURCES += \ |
105 | GENARCH_SOURCES += \ |
106 | ctl/gxe_fb.c |
106 | ctl/gxe_fb.c |
107 | else |
107 | else |
108 | GENARCH_SOURCES += \ |
108 | GENARCH_SOURCES += \ |
109 | ctl/stty.c |
109 | ctl/stty.c |
110 | endif |
110 | endif |
111 | endif |
111 | endif |
112 | 112 | ||
113 | ifeq ($(MACHINE), bgxemul) |
113 | ifeq ($(MACHINE), bgxemul) |
114 | GENARCH_SOURCES += \ |
114 | GENARCH_SOURCES += \ |
115 | port/gxemul.c \ |
115 | port/gxemul.c |
- | 116 | ||
- | 117 | ifeq ($(CONFIG_FB), y) |
|
- | 118 | GENARCH_SOURCES += \ |
|
- | 119 | ctl/gxe_fb.c |
|
- | 120 | else |
|
- | 121 | GENARCH_SOURCES += \ |
|
116 | ctl/stty.c |
122 | ctl/stty.c |
117 | endif |
123 | endif |
- | 124 | endif |
|
118 | 125 | ||
119 | ifeq ($(UARCH), ppc32) |
126 | ifeq ($(UARCH), ppc32) |
120 | GENARCH_SOURCES += \ |
127 | GENARCH_SOURCES += \ |
121 | port/dummy.c \ |
128 | port/dummy.c \ |
122 | ctl/stty.c |
129 | ctl/stty.c |
123 | endif |
130 | endif |
124 | 131 | ||
125 | ifeq ($(UARCH), sparc64) |
132 | ifeq ($(UARCH), sparc64) |
126 | ifeq ($(MACHINE),serengeti) |
133 | ifeq ($(MACHINE),serengeti) |
127 | GENARCH_SOURCES += \ |
134 | GENARCH_SOURCES += \ |
128 | port/sgcn.c \ |
135 | port/sgcn.c \ |
129 | ctl/stty.c |
136 | ctl/stty.c |
130 | else |
137 | else |
131 | GENARCH_SOURCES += \ |
138 | GENARCH_SOURCES += \ |
132 | port/sun.c \ |
139 | port/sun.c \ |
133 | port/z8530.c \ |
140 | port/z8530.c \ |
134 | port/ns16550.c \ |
141 | port/ns16550.c \ |
135 | ctl/sun.c |
142 | ctl/sun.c |
136 | endif |
143 | endif |
137 | endif |
144 | endif |
138 | 145 | ||
139 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
146 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
140 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
147 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
141 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
148 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
142 | 149 | ||
143 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
150 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
144 | 151 | ||
145 | .PHONY: all clean depend disasm links |
152 | .PHONY: all clean depend disasm links |
146 | 153 | ||
147 | all: $(OUTPUT) $(OUTPUT).disasm |
154 | all: $(OUTPUT) $(OUTPUT).disasm |
148 | 155 | ||
149 | -include Makefile.depend |
156 | -include Makefile.depend |
150 | 157 | ||
151 | clean: |
158 | clean: |
152 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
159 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
153 | 160 | ||
154 | depend: |
161 | depend: |
155 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
162 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
156 | 163 | ||
157 | $(OUTPUT): $(OBJECTS) $(LIBS) |
164 | $(OUTPUT): $(OBJECTS) $(LIBS) |
158 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
165 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
159 | 166 | ||
160 | disasm: $(OUTPUT).disasm |
167 | disasm: $(OUTPUT).disasm |
161 | 168 | ||
162 | $(OUTPUT).disasm: $(OUTPUT) |
169 | $(OUTPUT).disasm: $(OUTPUT) |
163 | $(OBJDUMP) -d $< >$@ |
170 | $(OBJDUMP) -d $< >$@ |
164 | 171 | ||
165 | %.o: %.S |
172 | %.o: %.S |
166 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
173 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
167 | 174 | ||
168 | %.o: %.s |
175 | %.o: %.s |
169 | $(AS) $(AFLAGS) $< -o $@ |
176 | $(AS) $(AFLAGS) $< -o $@ |
170 | 177 | ||
171 | %.o: %.c |
178 | %.o: %.c |
172 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
179 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
173 | 180 |