diff options
author | Kyle McMartin <kyle@shortfin.cabal.ca> | 2007-10-18 16:54:51 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@shortfin.cabal.ca> | 2007-10-18 16:54:51 -0400 |
commit | 991b7d6e6ffe9373dca7269a5d0213c1545dee1f (patch) | |
tree | db93c49b04ac7190400e8a9b98becab76057bb6a /arch | |
parent | 9611f61eb5baf22b6b6ed46c2c196c10e1fade6a (diff) |
[PARISC] Attempt to clean up parisc/Makefile
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/Makefile | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 20d327f63d57..3ea7ce3a8c57 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile | |||
@@ -19,26 +19,27 @@ | |||
19 | NM = sh $(srctree)/arch/parisc/nm | 19 | NM = sh $(srctree)/arch/parisc/nm |
20 | CHECKFLAGS += -D__hppa__=1 | 20 | CHECKFLAGS += -D__hppa__=1 |
21 | 21 | ||
22 | MACHINE := $(shell uname -m) | ||
23 | ifeq ($(MACHINE),parisc*) | ||
24 | NATIVE := 1 | ||
25 | endif | ||
26 | |||
22 | ifdef CONFIG_64BIT | 27 | ifdef CONFIG_64BIT |
23 | CROSS_COMPILE := $(shell if [ -x /usr/bin/hppa64-linux-gnu-gcc ]; then \ | ||
24 | echo hppa64-linux-gnu-; else echo hppa64-linux-; fi) | ||
25 | UTS_MACHINE := parisc64 | 28 | UTS_MACHINE := parisc64 |
26 | CHECKFLAGS += -D__LP64__=1 -m64 | 29 | CHECKFLAGS += -D__LP64__=1 -m64 |
27 | else | 30 | WIDTH := 64 |
28 | MACHINE := $(subst 64,,$(shell uname -m)) | 31 | CROSS_COMPILE := hppa64-linux-gnu- |
29 | ifneq ($(MACHINE),parisc) | 32 | else # 32-bit |
30 | CROSS_COMPILE := hppa-linux- | 33 | WIDTH := |
31 | endif | ||
32 | endif | 34 | endif |
33 | 35 | ||
34 | FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align | 36 | # attempt to help out folks who are cross-compiling |
37 | ifeq ($(NATIVE),1) | ||
38 | CROSS_COMPILE := hppa$(WIDTH)-linux- | ||
39 | endif | ||
35 | 40 | ||
36 | OBJCOPY_FLAGS =-O binary -R .note -R .comment -S | 41 | OBJCOPY_FLAGS =-O binary -R .note -R .comment -S |
37 | 42 | ||
38 | ifneq ($(call cc-ifversion, -lt, 0303, "bad"),) | ||
39 | $(error Sorry, GCC v3.3 or above is required.) | ||
40 | endif | ||
41 | |||
42 | cflags-y := -pipe | 43 | cflags-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 |
@@ -73,31 +74,8 @@ libs-y += arch/parisc/lib/ | |||
73 | 74 | ||
74 | drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ | 75 | drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ |
75 | 76 | ||
76 | PALO := $(shell if which palo; then : ; \ | 77 | # Shorthands for known targets not supported by parisc, use vmlinux as default |
77 | elif [ -x /sbin/palo ]; then echo /sbin/palo; \ | 78 | Image zImage bzImage: vmlinux |
78 | fi) | ||
79 | |||
80 | palo: vmlinux | ||
81 | @if [ -x $PALO ]; then \ | ||
82 | echo 'ERROR: Please install palo first (apt-get install palo)';\ | ||
83 | echo 'or build it from source and install it somewhere in your $$PATH';\ | ||
84 | false; \ | ||
85 | fi | ||
86 | @if [ ! -f ./palo.conf ]; then \ | ||
87 | cp arch/parisc/defpalo.conf palo.conf; \ | ||
88 | echo 'A generic palo config file (./palo.conf) has been created for you.'; \ | ||
89 | echo 'You should check it and re-run "make palo".'; \ | ||
90 | echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \ | ||
91 | false; \ | ||
92 | fi | ||
93 | $(PALO) -f ./palo.conf | ||
94 | |||
95 | oldpalo: vmlinux | ||
96 | export TOPDIR=`pwd`; \ | ||
97 | unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage | ||
98 | |||
99 | # Shorthands for known targets not supported by parisc, use palo as default | ||
100 | Image zImage bzImage: palo | ||
101 | 79 | ||
102 | kernel_install: vmlinux | 80 | kernel_install: vmlinux |
103 | sh $(src)/arch/parisc/install.sh \ | 81 | sh $(src)/arch/parisc/install.sh \ |
@@ -110,9 +88,17 @@ MRPROPER_FILES += palo.conf | |||
110 | 88 | ||
111 | define archhelp | 89 | define archhelp |
112 | @echo '* vmlinux - Uncompressed kernel image (./vmlinux)' | 90 | @echo '* vmlinux - Uncompressed kernel image (./vmlinux)' |
113 | @echo ' palo - Bootable image (./lifimage)' | ||
114 | @echo ' install - Install kernel using' | 91 | @echo ' install - Install kernel using' |
115 | @echo ' (your) ~/bin/installkernel or' | 92 | @echo ' (your) ~/bin/installkernel or' |
116 | @echo ' (distribution) /sbin/installkernel or' | 93 | @echo ' (distribution) /sbin/installkernel or' |
117 | @echo ' copy to $$(INSTALL_PATH)' | 94 | @echo ' copy to $$(INSTALL_PATH)' |
118 | endef | 95 | endef |
96 | |||
97 | # we require gcc 3.3 or above to compile the kernel | ||
98 | archprepare: checkbin | ||
99 | checkbin: | ||
100 | @if test "$(call cc-version)" -lt "0303"; then \ | ||
101 | echo -n "Sorry, GCC v3.3 or above is required to build " ; \ | ||
102 | echo "the kernel." ; \ | ||
103 | false ; \ | ||
104 | fi | ||