Rev 3924 | Rev 3926 | 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 |
||
3882 | decky | 34 | |
3803 | decky | 35 | include $(LIBC_PREFIX)/Makefile.toolchain |
1339 | cejka | 36 | |
1352 | palkovsky | 37 | CFLAGS += -Iinclude -I../libadt/include |
1339 | cejka | 38 | |
1352 | palkovsky | 39 | LIBS = $(LIBC_PREFIX)/libc.a |
1339 | cejka | 40 | |
41 | ## Sources |
||
42 | # |
||
43 | |||
44 | OUTPUT = kbd |
||
45 | GENERIC_SOURCES = \ |
||
46 | generic/kbd.c \ |
||
47 | generic/key_buffer.c |
||
48 | |||
3923 | svoboda | 49 | ARCH_SOURCES = |
50 | GENARCH_SOURCES = |
||
1339 | cejka | 51 | |
3923 | svoboda | 52 | ifeq ($(KBD_LAYOUT), us_qwerty) |
53 | GENARCH_SOURCES += layout/us_qwerty.c |
||
54 | endif |
||
55 | ifeq ($(KBD_LAYOUT), us_dvorak) |
||
56 | GENARCH_SOURCES += layout/us_dvorak.c |
||
57 | endif |
||
58 | |||
59 | ifeq ($(UARCH), amd64) |
||
60 | GENARCH_SOURCES += \ |
||
61 | port/i8042.c \ |
||
62 | ctl/pc.c |
||
63 | endif |
||
64 | ifeq ($(UARCH), arm32) |
||
65 | GENARCH_SOURCES += \ |
||
66 | port/gxemul.c |
||
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 |
||
3882 | decky | 75 | ifeq ($(UARCH), ia32) |
3923 | svoboda | 76 | GENARCH_SOURCES += \ |
77 | port/i8042.c \ |
||
78 | ctl/pc.c |
||
1707 | palkovsky | 79 | endif |
3882 | decky | 80 | ifeq ($(UARCH), ia64) |
3923 | svoboda | 81 | GENARCH_SOURCES += \ |
82 | port/dummy.c \ |
||
83 | ctl/stty.c |
||
3661 | vana | 84 | endif |
3923 | svoboda | 85 | ifeq ($(MACHINE), msim) |
86 | GENARCH_SOURCES += \ |
||
87 | port/msim.c \ |
||
88 | ctl/stty.c |
||
1707 | palkovsky | 89 | endif |
3923 | svoboda | 90 | ifeq ($(MACHINE), lgxemul) |
91 | GENARCH_SOURCES += \ |
||
92 | port/gxemul.c |
||
93 | ifeq ($(CONFIG_FB), y) |
||
94 | GENARCH_SOURCES += \ |
||
95 | ctl/gxe_fb.c |
||
96 | else |
||
97 | GENARCH_SOURCES += \ |
||
98 | ctl/stty.c |
||
99 | endif |
||
1873 | jermar | 100 | endif |
3923 | svoboda | 101 | ifeq ($(MACHINE), bgxemul) |
102 | GENARCH_SOURCES += \ |
||
103 | port/gxemul.c \ |
||
104 | ctl/stty.c |
||
2465 | jermar | 105 | endif |
3923 | svoboda | 106 | ifeq ($(UARCH), ppc32) |
3672 | jermar | 107 | GENARCH_SOURCES += \ |
3923 | svoboda | 108 | port/dummy.c \ |
109 | ctl/stty.c |
||
3672 | jermar | 110 | endif |
3923 | svoboda | 111 | ifeq ($(UARCH), sparc64) |
3754 | svoboda | 112 | GENARCH_SOURCES += \ |
3925 | svoboda | 113 | port/z8530.c \ |
3924 | svoboda | 114 | ctl/sun.c |
3754 | svoboda | 115 | endif |
1707 | palkovsky | 116 | |
1339 | cejka | 117 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
118 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
||
1873 | jermar | 119 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
1339 | cejka | 120 | |
3699 | svoboda | 121 | OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
122 | |||
1339 | cejka | 123 | .PHONY: all clean depend disasm links |
124 | |||
3201 | svoboda | 125 | all: links $(OUTPUT) $(OUTPUT).disasm |
1339 | cejka | 126 | |
127 | -include Makefile.depend |
||
128 | |||
129 | links: |
||
3882 | decky | 130 | ln -sfn ../arch/$(UARCH)/include include/arch |
1873 | jermar | 131 | ln -sfn ../genarch/include include/genarch |
1339 | cejka | 132 | |
133 | clean: |
||
3699 | svoboda | 134 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
1339 | cejka | 135 | |
136 | depend: |
||
137 | $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
||
138 | |||
3699 | svoboda | 139 | $(OUTPUT): $(OBJECTS) $(LIBS) |
3882 | decky | 140 | $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
1339 | cejka | 141 | |
3201 | svoboda | 142 | disasm: $(OUTPUT).disasm |
1339 | cejka | 143 | |
3201 | svoboda | 144 | $(OUTPUT).disasm: $(OUTPUT) |
145 | $(OBJDUMP) -d $< >$@ |
||
146 | |||
1339 | cejka | 147 | %.o: %.S |
148 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
||
149 | |||
150 | %.o: %.s |
||
151 | $(AS) $(AFLAGS) $< -o $@ |
||
152 | |||
153 | %.o: %.c |
||
154 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |