File: GNUmakerules

package info (click to toggle)
oskit 0.97.20000202-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 58,008 kB
  • ctags: 172,612
  • sloc: ansic: 832,827; asm: 7,640; sh: 3,920; yacc: 3,664; perl: 1,457; lex: 427; makefile: 337; csh: 141; awk: 78
file content (101 lines) | stat: -rw-r--r-- 3,850 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright (c) 1997-1999 The University of Utah and the Flux Group.
# 
# This file is part of the OSKit Linux Glue Libraries, which are free
# software, also known as "open source;" you can redistribute them and/or
# modify them under the terms of the GNU General Public License (GPL),
# version 2, as published by the Free Software Foundation (FSF).
# 
# The OSKit is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GPL for more details.  You should have
# received a copy of the GPL along with the OSKit; see the file COPYING.  If
# not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA.
#

#
# This make cruft is shared between the Linux fs and dev stuff.
# The respective fs and dev makefiles include this file,
# which should be done after setting $(OBJFILES).
#

ifndef _oskit_linux_shared_makerules_
_oskit_linux_shared_makerules_ = yes

# Translate oskit architecture names (host_arch in configure.in)
# to the Linux architecture names used to name the Linux source directories.
LINUX_ARCH-x86 := i386
LINUX_ARCH-arm32 := arm
LINUX_HOST_ARCH := $(firstword $(LINUX_ARCH-$(HOST_ARCH)) $(HOST_ARCH))

SRCDIRS +=	$(OSKIT_SRCDIR)/linux/shared			\
		$(OSKIT_SRCDIR)/linux/shared/libc		\
		$(OSKIT_SRCDIR)/linux/shared/$(HOST_ARCH)	\
		$(OSKIT_SRCDIR)/linux/src/lib			\
		$(OSKIT_SRCDIR)/linux/src/arch/$(LINUX_HOST_ARCH)/lib

INCDIRS +=	$(OSKIT_SRCDIR)/linux/src/include		\
		$(OSKIT_SRCDIR)/linux/shared/libc		\
		objinclude

DEFINES += -DOSKIT -D__KERNEL__

# If debugging is enabled,
# define the symbol OSKIT_DEBUG instead of the usual DEBUG,
# because the Linux drivers have their own meaning for DEBUG.
ifneq "$(filter -DDEBUG, $(DEFINES))" ""
DEFINES := $(subst -DDEBUG, -DOSKIT_DEBUG, $(DEFINES))
endif

#
# We need to do this here since it adds stuff to $(OBJFILES).
#
### Include other appropriate make rules files ###
include $(OSKIT_SRCDIR)/GNUmakerules-lib

OSKIT_ASFLAGS += -D__ASSEMBLY__

# Implicitly include the shared global.h header file at the top of all sources.
# This header #defines a bunch of global Linux symbols
# to ensure linker namespace cleanliness and avoid conflicts.
OSKIT_CPPFLAGS += -include $(OSKIT_SRCDIR)/linux/shared/global.h
$(OBJFILES): $(OSKIT_SRCDIR)/linux/shared/global.h

# Create the objinclude/asm include symlink.
# We have to kludge a little to get it to work right,
# because OSKIT_SRCDIR might be either an absolute or a relative path
# and it will only work reliably if interpreted from _this_ directory.
$(OBJFILES): objinclude/asm
CLEAN_FILES += objinclude objinclude_asm
objinclude/asm:
	-mkdir -p objinclude
	ln -s ../objinclude_asm objinclude/asm
	ln -s $(OSKIT_SRCDIR)/linux/src/include/asm-$(LINUX_HOST_ARCH) objinclude_asm

#
# This needs config help. For now all ARM32 builds use the same subdirs.
# The proc subdir points to proc-armv, which should be fine for anything
# we care about. For the arch subdir, we will use the ebsa285 subdir, since
# that looks generic enough, and besides we don't really care about 90% of
# it. It just needs to keep the compiler happy. We need to toss in the
# appropriate CONFIG definitions too.
#
ifeq ($(HOST_ARCH), arm32)
$(OBJFILES): archinclude/asm/proc archinclude/asm/arch
CLEAN_FILES += archinclude archinclude_asmproc archinclude_asmarch
INCDIRS += archinclude

archinclude/asm/proc:
	-mkdir -p archinclude/asm
	ln -fs ../../archinclude_asmproc archinclude/asm/proc
	ln -fs $(OSKIT_SRCDIR)/linux/src/include/asm-$(LINUX_HOST_ARCH)/proc-armv \
					archinclude_asmproc

archinclude/asm/arch:
	-mkdir -p archinclude/asm
	ln -fs ../../archinclude_asmarch archinclude/asm/arch
	ln -fs $(OSKIT_SRCDIR)/linux/src/include/asm-$(LINUX_HOST_ARCH)/arch-ebsa285 \
					archinclude_asmarch

endif
endif