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