Rev 4354 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1339 | cejka | 1 | # |
2071 | jermar | 2 | # Copyright (c) 2005 Martin Decky |
1339 | cejka | 3 | # All rights reserved. |
4 | # |
||
5 | # Redistribution and use in source and binary forms, with or without |
||
6 | # modification, are permitted provided that the following conditions |
||
7 | # are met: |
||
8 | # |
||
9 | # - Redistributions of source code must retain the above copyright |
||
10 | # notice, this list of conditions and the following disclaimer. |
||
11 | # - Redistributions in binary form must reproduce the above copyright |
||
12 | # notice, this list of conditions and the following disclaimer in the |
||
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 |
||
15 | # derived from this software without specific prior written permission. |
||
16 | # |
||
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 |
||
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
||
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
||
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 |
||
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 |
||
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||
27 | # |
||
28 | |||
29 | ## Setup toolchain |
||
30 | # |
||
31 | |||
2479 | jermar | 32 | LIBC_PREFIX = ../../lib/libc |
33 | SOFTINT_PREFIX = ../../lib/softint |
||
4340 | svoboda | 34 | |
1339 | cejka | 35 | include $(LIBC_PREFIX)/Makefile.toolchain |
3563 | svoboda | 36 | include $(LIBC_PREFIX)/Makefile.app |
1339 | cejka | 37 | |
4691 | svoboda | 38 | CFLAGS += -Iinclude |
1339 | cejka | 39 | |
40 | ## Sources |
||
41 | # |
||
42 | |||
43 | OUTPUT = kbd |
||
44 | GENERIC_SOURCES = \ |
||
45 | generic/kbd.c \ |
||
4346 | svoboda | 46 | genarch/gsp.c \ |
47 | genarch/stroke.c \ |
||
4691 | svoboda | 48 | generic/keybuffer.c |
1339 | cejka | 49 | |
4343 | svoboda | 50 | ARCH_SOURCES = |
4348 | svoboda | 51 | GENARCH_SOURCES = \ |
52 | layout/cz.c \ |
||
53 | layout/us_qwerty.c \ |
||
54 | layout/us_dvorak.c |
||
1339 | cejka | 55 | |
4343 | svoboda | 56 | ifeq ($(UARCH), amd64) |
57 | GENARCH_SOURCES += \ |
||
58 | port/i8042.c \ |
||
59 | ctl/pc.c |
||
60 | endif |
||
4348 | svoboda | 61 | |
4343 | svoboda | 62 | ifeq ($(UARCH), arm32) |
4691 | svoboda | 63 | ifeq ($(MACHINE), testarm) |
4343 | svoboda | 64 | GENARCH_SOURCES += \ |
65 | port/gxemul.c |
||
4348 | svoboda | 66 | |
4343 | svoboda | 67 | ifeq ($(CONFIG_FB), y) |
68 | GENARCH_SOURCES += \ |
||
69 | ctl/gxe_fb.c |
||
70 | else |
||
71 | GENARCH_SOURCES += \ |
||
72 | ctl/stty.c |
||
73 | endif |
||
74 | endif |
||
4691 | svoboda | 75 | ifeq ($(MACHINE), integratorcp) |
76 | GENARCH_SOURCES += \ |
||
77 | port/pl050.c \ |
||
78 | ctl/pl050.c |
||
79 | endif |
||
80 | endif |
||
4348 | svoboda | 81 | |
4342 | svoboda | 82 | ifeq ($(UARCH), ia32) |
4343 | svoboda | 83 | GENARCH_SOURCES += \ |
84 | port/i8042.c \ |
||
85 | ctl/pc.c |
||
1707 | palkovsky | 86 | endif |
4348 | svoboda | 87 | |
4346 | svoboda | 88 | ifeq ($(MACHINE), i460GX) |
4343 | svoboda | 89 | GENARCH_SOURCES += \ |
4344 | svoboda | 90 | port/i8042.c \ |
91 | ctl/pc.c |
||
3674 | svoboda | 92 | endif |
4348 | svoboda | 93 | |
4346 | svoboda | 94 | ifeq ($(MACHINE), ski) |
95 | GENARCH_SOURCES += \ |
||
96 | port/ski.c \ |
||
97 | ctl/stty.c |
||
98 | endif |
||
4348 | svoboda | 99 | |
4343 | svoboda | 100 | ifeq ($(MACHINE), msim) |
101 | GENARCH_SOURCES += \ |
||
102 | port/msim.c \ |
||
103 | ctl/stty.c |
||
1707 | palkovsky | 104 | endif |
4348 | svoboda | 105 | |
4343 | svoboda | 106 | ifeq ($(MACHINE), lgxemul) |
107 | GENARCH_SOURCES += \ |
||
108 | port/gxemul.c |
||
4348 | svoboda | 109 | |
4343 | svoboda | 110 | ifeq ($(CONFIG_FB), y) |
111 | GENARCH_SOURCES += \ |
||
112 | ctl/gxe_fb.c |
||
113 | else |
||
114 | GENARCH_SOURCES += \ |
||
115 | ctl/stty.c |
||
116 | endif |
||
1873 | jermar | 117 | endif |
4348 | svoboda | 118 | |
4343 | svoboda | 119 | ifeq ($(MACHINE), bgxemul) |
120 | GENARCH_SOURCES += \ |
||
4348 | svoboda | 121 | port/gxemul.c |
122 | |||
123 | ifeq ($(CONFIG_FB), y) |
||
124 | GENARCH_SOURCES += \ |
||
125 | ctl/gxe_fb.c |
||
126 | else |
||
127 | GENARCH_SOURCES += \ |
||
128 | ctl/stty.c |
||
129 | endif |
||
2465 | jermar | 130 | endif |
4348 | svoboda | 131 | |
4343 | svoboda | 132 | ifeq ($(UARCH), ppc32) |
3674 | svoboda | 133 | GENARCH_SOURCES += \ |
4343 | svoboda | 134 | port/dummy.c \ |
135 | ctl/stty.c |
||
3674 | svoboda | 136 | endif |
4348 | svoboda | 137 | |
4343 | svoboda | 138 | ifeq ($(UARCH), sparc64) |
4348 | svoboda | 139 | ifeq ($(MACHINE),serengeti) |
140 | GENARCH_SOURCES += \ |
||
141 | port/sgcn.c \ |
||
142 | ctl/stty.c |
||
143 | else |
||
144 | GENARCH_SOURCES += \ |
||
145 | port/sun.c \ |
||
146 | port/z8530.c \ |
||
147 | port/ns16550.c \ |
||
148 | ctl/sun.c |
||
149 | endif |
||
4338 | svoboda | 150 | endif |
1707 | palkovsky | 151 | |
1339 | cejka | 152 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
153 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
||
1873 | jermar | 154 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
1339 | cejka | 155 | |
4337 | svoboda | 156 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
157 | |||
1339 | cejka | 158 | .PHONY: all clean depend disasm links |
159 | |||
4346 | svoboda | 160 | all: $(OUTPUT) $(OUTPUT).disasm |
1339 | cejka | 161 | |
162 | -include Makefile.depend |
||
163 | |||
164 | clean: |
||
4346 | svoboda | 165 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
1339 | cejka | 166 | |
167 | depend: |
||
168 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
||
169 | |||
4337 | svoboda | 170 | $(OUTPUT): $(OBJECTS) $(LIBS) |
171 | $(LD) -T $(LD_SCRIPT) $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
||
1339 | cejka | 172 | |
3211 | svoboda | 173 | disasm: $(OUTPUT).disasm |
1339 | cejka | 174 | |
3211 | svoboda | 175 | $(OUTPUT).disasm: $(OUTPUT) |
4691 | svoboda | 176 | $(OBJDUMP) -d $< > $@ |
3211 | svoboda | 177 | |
1339 | cejka | 178 | %.o: %.S |
179 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
||
180 | |||
181 | %.o: %.s |
||
182 | $(AS) $(AFLAGS) $< -o $@ |
||
183 | |||
184 | %.o: %.c |
||
185 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |