]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/parisc/Makefile
[PARISC] Fix palo target
[karo-tx-linux.git] / arch / parisc / Makefile
index f3d0d7c7097782bb43bf2e93d5e0eead251274bc..f93c4cd7798005c0800e81942ca3b32cdef0fd5b 100644 (file)
 NM             = sh $(srctree)/arch/parisc/nm
 CHECKFLAGS     += -D__hppa__=1
 
+MACHINE                := $(shell uname -m)
+ifeq ($(MACHINE),parisc*)
+NATIVE         := 1
+endif
+
 ifdef CONFIG_64BIT
-CROSS_COMPILE  := $(shell if [ -x /usr/bin/hppa64-linux-gnu-gcc ]; then \
-                       echo hppa64-linux-gnu-; else echo hppa64-linux-; fi)
 UTS_MACHINE    := parisc64
 CHECKFLAGS     += -D__LP64__=1 -m64
-else
-MACHINE := $(subst 64,,$(shell uname -m))
-ifneq ($(MACHINE),parisc)
-CROSS_COMPILE  := hppa-linux-
-endif
+WIDTH          := 64
+CROSS_COMPILE  := hppa64-linux-gnu-
+else # 32-bit
+WIDTH          :=
 endif
 
-FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align 
+# attempt to help out folks who are cross-compiling
+ifeq ($(NATIVE),1)
+CROSS_COMPILE  := hppa$(WIDTH)-linux-
+endif
 
 OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
 
-ifneq ($(call cc-ifversion, -lt, 0303, "bad"),)
-$(error Sorry, GCC v3.3 or above is required.)
-endif
-
 cflags-y       := -pipe
 
 # 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
 kernel-$(CONFIG_HPUX)          += hpux/
 
 core-y += $(addprefix arch/parisc/, $(kernel-y))
-libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
+libs-y += arch/parisc/lib/
 
 drivers-$(CONFIG_OPROFILE)             += arch/parisc/oprofile/
 
@@ -78,7 +79,7 @@ PALO := $(shell if which palo; then : ; \
        fi)
 
 palo: vmlinux
-       @if [ -x $PALO ]; then \
+       @if [ ! -x $(PALO) ]; then \
                echo 'ERROR: Please install palo first (apt-get install palo)';\
                echo 'or build it from source and install it somewhere in your $$PATH';\
                false; \
@@ -92,12 +93,8 @@ palo: vmlinux
        fi
        $(PALO) -f ./palo.conf
 
-oldpalo: vmlinux
-       export TOPDIR=`pwd`; \
-       unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
-
-# Shorthands for known targets not supported by parisc, use palo as default
-Image zImage bzImage: palo
+# Shorthands for known targets not supported by parisc, use vmlinux as default
+Image zImage bzImage: vmlinux
 
 kernel_install: vmlinux
        sh $(src)/arch/parisc/install.sh \
@@ -116,3 +113,12 @@ define archhelp
        @echo  '                  (distribution) /sbin/installkernel or'
        @echo  '                  copy to $$(INSTALL_PATH)'
 endef
+
+# we require gcc 3.3 or above to compile the kernel
+archprepare: checkbin
+checkbin:
+       @if test "$(call cc-version)" -lt "0303"; then \
+               echo -n "Sorry, GCC v3.3 or above is required to build " ; \
+               echo "the kernel." ; \
+               false ; \
+       fi