Subversion Repositories HelenOS

Rev

Rev 4348 | 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
 
1352 palkovsky 38
CFLAGS += -Iinclude -I../libadt/include
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 \
1339 cejka 48
	generic/key_buffer.c
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)
63
	GENARCH_SOURCES += \
64
		port/gxemul.c
4348 svoboda 65
 
4343 svoboda 66
	ifeq ($(CONFIG_FB), y)
67
		GENARCH_SOURCES += \
68
			ctl/gxe_fb.c
69
	else
70
		GENARCH_SOURCES += \
71
			ctl/stty.c
72
	endif
73
endif
4348 svoboda 74
 
4342 svoboda 75
ifeq ($(UARCH), ia32)
4343 svoboda 76
	GENARCH_SOURCES += \
77
		port/i8042.c \
78
		ctl/pc.c
1707 palkovsky 79
endif
4348 svoboda 80
 
4346 svoboda 81
ifeq ($(MACHINE), i460GX)
4343 svoboda 82
	GENARCH_SOURCES += \
4344 svoboda 83
		port/i8042.c \
84
		ctl/pc.c
3674 svoboda 85
endif
4348 svoboda 86
 
4346 svoboda 87
ifeq ($(MACHINE), ski)
88
	GENARCH_SOURCES += \
89
		port/ski.c \
90
		ctl/stty.c
91
endif
4348 svoboda 92
 
4343 svoboda 93
ifeq ($(MACHINE), msim)
94
	GENARCH_SOURCES += \
95
		port/msim.c \
96
		ctl/stty.c
1707 palkovsky 97
endif
4348 svoboda 98
 
4343 svoboda 99
ifeq ($(MACHINE), lgxemul)
100
	GENARCH_SOURCES += \
101
		port/gxemul.c
4348 svoboda 102
 
4343 svoboda 103
	ifeq ($(CONFIG_FB), y)
104
		GENARCH_SOURCES += \
105
			ctl/gxe_fb.c
106
	else
107
		GENARCH_SOURCES += \
108
			ctl/stty.c
109
	endif
1873 jermar 110
endif
4348 svoboda 111
 
4343 svoboda 112
ifeq ($(MACHINE), bgxemul)
113
	GENARCH_SOURCES += \
4348 svoboda 114
		port/gxemul.c
115
 
116
	ifeq ($(CONFIG_FB), y)
117
		GENARCH_SOURCES += \
118
			ctl/gxe_fb.c
119
	else
120
		GENARCH_SOURCES += \
121
			ctl/stty.c
122
	endif
2465 jermar 123
endif
4348 svoboda 124
 
4343 svoboda 125
ifeq ($(UARCH), ppc32)
3674 svoboda 126
	GENARCH_SOURCES += \
4343 svoboda 127
		port/dummy.c \
128
		ctl/stty.c
3674 svoboda 129
endif
4348 svoboda 130
 
4343 svoboda 131
ifeq ($(UARCH), sparc64)
4348 svoboda 132
	ifeq ($(MACHINE),serengeti)
133
		GENARCH_SOURCES += \
134
			port/sgcn.c \
135
			ctl/stty.c
136
	else
137
		GENARCH_SOURCES += \
138
			port/sun.c \
139
			port/z8530.c \
140
			port/ns16550.c \
141
			ctl/sun.c
142
	endif
4338 svoboda 143
endif
1707 palkovsky 144
 
1339 cejka 145
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
146
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
1873 jermar 147
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
1339 cejka 148
 
4337 svoboda 149
OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS)
150
 
1339 cejka 151
.PHONY: all clean depend disasm links
152
 
4346 svoboda 153
all: $(OUTPUT) $(OUTPUT).disasm
1339 cejka 154
 
155
-include Makefile.depend
156
 
157
clean:
4346 svoboda 158
	-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS)
1339 cejka 159
 
160
depend:
161
	$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
162
 
4337 svoboda 163
$(OUTPUT): $(OBJECTS) $(LIBS)
164
	$(LD) -T $(LD_SCRIPT) $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
1339 cejka 165
 
3211 svoboda 166
disasm: $(OUTPUT).disasm
1339 cejka 167
 
3211 svoboda 168
$(OUTPUT).disasm: $(OUTPUT)
169
	$(OBJDUMP) -d $< >$@
170
 
1339 cejka 171
%.o: %.S
172
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
173
 
174
%.o: %.s
175
	$(AS) $(AFLAGS) $< -o $@
176
 
177
%.o: %.c
178
	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@