aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/Makefile')
-rw-r--r--arch/parisc/Makefile58
1 files changed, 34 insertions, 24 deletions
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index f3d0d7c70977..ae4a9b3d4fd6 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -19,26 +19,27 @@
19NM = sh $(srctree)/arch/parisc/nm 19NM = sh $(srctree)/arch/parisc/nm
20CHECKFLAGS += -D__hppa__=1 20CHECKFLAGS += -D__hppa__=1
21 21
22MACHINE := $(shell uname -m)
23ifeq ($(MACHINE),parisc*)
24NATIVE := 1
25endif
26
22ifdef CONFIG_64BIT 27ifdef CONFIG_64BIT
23CROSS_COMPILE := $(shell if [ -x /usr/bin/hppa64-linux-gnu-gcc ]; then \
24 echo hppa64-linux-gnu-; else echo hppa64-linux-; fi)
25UTS_MACHINE := parisc64 28UTS_MACHINE := parisc64
26CHECKFLAGS += -D__LP64__=1 -m64 29CHECKFLAGS += -D__LP64__=1 -m64
27else 30WIDTH := 64
28MACHINE := $(subst 64,,$(shell uname -m)) 31CROSS_COMPILE := hppa64-linux-gnu-
29ifneq ($(MACHINE),parisc) 32else # 32-bit
30CROSS_COMPILE := hppa-linux- 33WIDTH :=
31endif
32endif 34endif
33 35
34FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align 36# attempt to help out folks who are cross-compiling
37ifeq ($(NATIVE),1)
38CROSS_COMPILE := hppa$(WIDTH)-linux-
39endif
35 40
36OBJCOPY_FLAGS =-O binary -R .note -R .comment -S 41OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
37 42
38ifneq ($(call cc-ifversion, -lt, 0303, "bad"),)
39$(error Sorry, GCC v3.3 or above is required.)
40endif
41
42cflags-y := -pipe 43cflags-y := -pipe
43 44
44# These flags should be implied by an hppa-linux configuration, but they 45# These flags should be implied by an hppa-linux configuration, but they
@@ -69,7 +70,7 @@ kernel-y := mm/ kernel/ math-emu/ kernel/init_task.o
69kernel-$(CONFIG_HPUX) += hpux/ 70kernel-$(CONFIG_HPUX) += hpux/
70 71
71core-y += $(addprefix arch/parisc/, $(kernel-y)) 72core-y += $(addprefix arch/parisc/, $(kernel-y))
72libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name` 73libs-y += arch/parisc/lib/
73 74
74drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ 75drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
75 76
@@ -77,27 +78,27 @@ PALO := $(shell if which palo; then : ; \
77 elif [ -x /sbin/palo ]; then echo /sbin/palo; \ 78 elif [ -x /sbin/palo ]; then echo /sbin/palo; \
78 fi) 79 fi)
79 80
81PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
82 else echo $(obj)/palo.conf; \
83 fi)
84
80palo: vmlinux 85palo: vmlinux
81 @if [ -x $PALO ]; then \ 86 @if test ! -x "$(PALO)"; then \
82 echo 'ERROR: Please install palo first (apt-get install palo)';\ 87 echo 'ERROR: Please install palo first (apt-get install palo)';\
83 echo 'or build it from source and install it somewhere in your $$PATH';\ 88 echo 'or build it from source and install it somewhere in your $$PATH';\
84 false; \ 89 false; \
85 fi 90 fi
86 @if [ ! -f ./palo.conf ]; then \ 91 @if test ! -f "$(PALOCONF)"; then \
87 cp arch/parisc/defpalo.conf palo.conf; \ 92 cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
88 echo 'A generic palo config file (./palo.conf) has been created for you.'; \ 93 echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
89 echo 'You should check it and re-run "make palo".'; \ 94 echo 'You should check it and re-run "make palo".'; \
90 echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \ 95 echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
91 false; \ 96 false; \
92 fi 97 fi
93 $(PALO) -f ./palo.conf 98 $(PALO) -f $(PALOCONF)
94
95oldpalo: vmlinux
96 export TOPDIR=`pwd`; \
97 unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
98 99
99# Shorthands for known targets not supported by parisc, use palo as default 100# Shorthands for known targets not supported by parisc, use vmlinux as default
100Image zImage bzImage: palo 101Image zImage bzImage: vmlinux
101 102
102kernel_install: vmlinux 103kernel_install: vmlinux
103 sh $(src)/arch/parisc/install.sh \ 104 sh $(src)/arch/parisc/install.sh \
@@ -116,3 +117,12 @@ define archhelp
116 @echo ' (distribution) /sbin/installkernel or' 117 @echo ' (distribution) /sbin/installkernel or'
117 @echo ' copy to $$(INSTALL_PATH)' 118 @echo ' copy to $$(INSTALL_PATH)'
118endef 119endef
120
121# we require gcc 3.3 or above to compile the kernel
122archprepare: checkbin
123checkbin:
124 @if test "$(call cc-version)" -lt "0303"; then \
125 echo -n "Sorry, GCC v3.3 or above is required to build " ; \
126 echo "the kernel." ; \
127 false ; \
128 fi