source: mainline/uspace/srv/kbd/Makefile@ fa024ce

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since fa024ce was fcd7053, checked in by Martin Decky <martin@…>, 17 years ago

cleanup configuration
code cleanup

  • Property mode set to 100644
File size: 3.6 KB
RevLine 
[51d6f80]1#
[df4ed85]2# Copyright (c) 2005 Martin Decky
[51d6f80]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
[00acd66]32LIBC_PREFIX = ../../lib/libc
33SOFTINT_PREFIX = ../../lib/softint
[fcd7053]34
[9a0367f]35include $(LIBC_PREFIX)/Makefile.toolchain
[51d6f80]36
[7ee6aff]37CFLAGS += -Iinclude -I../libadt/include
[51d6f80]38
[7ee6aff]39LIBS = $(LIBC_PREFIX)/libc.a
[51d6f80]40
41## Sources
42#
43
44OUTPUT = kbd
45GENERIC_SOURCES = \
46 generic/kbd.c \
47 generic/key_buffer.c
48
49ARCH_SOURCES = \
[fcd7053]50 arch/$(UARCH)/src/kbd.c
[51d6f80]51
[fcd7053]52ifeq ($(UARCH), ia32)
[9141377]53 ARCH_SOURCES += \
[fcd7053]54 arch/$(UARCH)/src/mouse.c \
55 arch/$(UARCH)/src/scanc.c
[9141377]56 GENARCH_SOURCES = \
57 genarch/src/kbd.c
[830ac99]58 CFLAGS += -DMOUSE_ENABLED
59endif
[fcd7053]60ifeq ($(UARCH), ia64)
[50b3d30]61 ARCH_SOURCES += \
[fcd7053]62 arch/$(UARCH)/src/mouse.c \
63 arch/$(UARCH)/src/scanc.c \
64 arch/$(UARCH)/src/lkbd.c
[50b3d30]65 GENARCH_SOURCES = \
66 genarch/src/kbd.c
67 CFLAGS += -DMOUSE_ENABLED
68endif
[fcd7053]69ifeq ($(UARCH), amd64)
[9141377]70 ARCH_SOURCES += \
[fcd7053]71 arch/$(UARCH)/src/mouse.c \
72 arch/$(UARCH)/src/scanc.c
[9141377]73 GENARCH_SOURCES = \
74 genarch/src/kbd.c
[830ac99]75 CFLAGS += -DMOUSE_ENABLED
76endif
[fcd7053]77ifeq ($(UARCH), sparc64)
[9141377]78 ARCH_SOURCES += \
[fcd7053]79 arch/$(UARCH)/src/scanc.c \
80 arch/$(UARCH)/src/sgcn.c
[9141377]81 GENARCH_SOURCES = \
[965dc18]82 genarch/src/kbd.c \
83 genarch/src/nofb.c
[9141377]84endif
[fcd7053]85ifeq ($(UARCH), arm32)
[6b781c0]86 ARCH_SOURCES += \
[fcd7053]87 arch/$(UARCH)/src/kbd_gxemul.c
[6b781c0]88endif
[fcd7053]89ifeq ($(UARCH), mips32)
[965dc18]90 GENARCH_SOURCES += \
91 genarch/src/nofb.c
[018e1e3]92endif
[fcd7053]93ifeq ($(UARCH), mips32eb)
[018e1e3]94 GENARCH_SOURCES += \
95 genarch/src/nofb.c
[965dc18]96endif
[830ac99]97
[51d6f80]98GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
99ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
[9141377]100GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
[51d6f80]101
[f0c9aff]102OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS)
103
[51d6f80]104.PHONY: all clean depend disasm links
105
[515a0102]106all: links $(OUTPUT) $(OUTPUT).disasm
[51d6f80]107
108-include Makefile.depend
109
110links:
[fcd7053]111 ln -sfn ../arch/$(UARCH)/include include/arch
[9141377]112 ln -sfn ../genarch/include include/genarch
[51d6f80]113
114clean:
[f0c9aff]115 -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS)
[51d6f80]116
117depend:
118 $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
119
[f0c9aff]120$(OUTPUT): $(OBJECTS) $(LIBS)
[fcd7053]121 $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
[51d6f80]122
[515a0102]123disasm: $(OUTPUT).disasm
124
125$(OUTPUT).disasm: $(OUTPUT)
126 $(OBJDUMP) -d $< >$@
[51d6f80]127
128%.o: %.S
129 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
130
131%.o: %.s
132 $(AS) $(AFLAGS) $< -o $@
133
134%.o: %.c
135 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
Note: See TracBrowser for help on using the repository browser.