Back to home page

LXR

 
 

    


0001 #
0002 # parisc/Makefile
0003 #
0004 # This file is included by the global makefile so that you can add your own
0005 # architecture-specific flags and dependencies. Remember to do have actions
0006 # for "archclean" and "archdep" for cleaning up and making dependencies for
0007 # this architecture
0008 #
0009 # This file is subject to the terms and conditions of the GNU General Public
0010 # License.  See the file "COPYING" in the main directory of this archive
0011 # for more details.
0012 #
0013 # Copyright (C) 1994 by Linus Torvalds
0014 # Portions Copyright (C) 1999 The Puffin Group
0015 #
0016 # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
0017 # Mike Shaver, Helge Deller and Martin K. Petersen
0018 #
0019 
0020 KBUILD_IMAGE := vmlinuz
0021 
0022 KBUILD_DEFCONFIG := default_defconfig
0023 
0024 NM              = sh $(srctree)/arch/parisc/nm
0025 CHECKFLAGS      += -D__hppa__=1
0026 LIBGCC          = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
0027 
0028 ifdef CONFIG_64BIT
0029 UTS_MACHINE     := parisc64
0030 CHECKFLAGS      += -D__LP64__=1 -m64
0031 CC_ARCHES       = hppa64
0032 else # 32-bit
0033 CC_ARCHES       = hppa hppa2.0 hppa1.1
0034 endif
0035 
0036 ifneq ($(SUBARCH),$(UTS_MACHINE))
0037         ifeq ($(CROSS_COMPILE),)
0038                 CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
0039                 CROSS_COMPILE := $(call cc-cross-prefix, \
0040                         $(foreach a,$(CC_ARCHES), \
0041                         $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
0042         endif
0043 endif
0044 
0045 OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
0046 
0047 cflags-y        := -pipe
0048 
0049 # These flags should be implied by an hppa-linux configuration, but they
0050 # are not in gcc 3.2.
0051 cflags-y        += -mno-space-regs
0052 
0053 # -mfast-indirect-calls is only relevant for 32-bit kernels.
0054 ifndef CONFIG_64BIT
0055 cflags-y        += -mfast-indirect-calls
0056 endif
0057 
0058 # Currently we save and restore fpregs on all kernel entry/interruption paths.
0059 # If that gets optimized, we might need to disable the use of fpregs in the
0060 # kernel.
0061 cflags-y        += -mdisable-fpregs
0062 
0063 # Without this, "ld -r" results in .text sections that are too big
0064 # (> 0x40000) for branches to reach stubs.
0065 cflags-y        += -ffunction-sections
0066 
0067 # Use long jumps instead of long branches (needed if your linker fails to
0068 # link a too big vmlinux executable). Not enabled for building modules.
0069 ifdef CONFIG_MLONGCALLS
0070 KBUILD_CFLAGS_KERNEL += -mlong-calls
0071 endif
0072 
0073 # select which processor to optimise for
0074 cflags-$(CONFIG_PA7000)         += -march=1.1 -mschedule=7100
0075 cflags-$(CONFIG_PA7200)         += -march=1.1 -mschedule=7200
0076 cflags-$(CONFIG_PA7100LC)       += -march=1.1 -mschedule=7100LC
0077 cflags-$(CONFIG_PA7300LC)       += -march=1.1 -mschedule=7300
0078 cflags-$(CONFIG_PA8X00)         += -march=2.0 -mschedule=8000
0079 
0080 head-y                  := arch/parisc/kernel/head.o 
0081 
0082 KBUILD_CFLAGS   += $(cflags-y)
0083 
0084 kernel-y                        := mm/ kernel/ math-emu/
0085 
0086 core-y  += $(addprefix arch/parisc/, $(kernel-y))
0087 libs-y  += arch/parisc/lib/ $(LIBGCC)
0088 
0089 drivers-$(CONFIG_OPROFILE)              += arch/parisc/oprofile/
0090 
0091 PALO := $(shell if (which palo 2>&1); then : ; \
0092         elif [ -x /sbin/palo ]; then echo /sbin/palo; \
0093         fi)
0094 
0095 PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
0096         else echo $(obj)/palo.conf; \
0097         fi)
0098 
0099 palo lifimage: vmlinuz
0100         @if test ! -x "$(PALO)"; then \
0101                 echo 'ERROR: Please install palo first (apt-get install palo)';\
0102                 echo 'or build it from source and install it somewhere in your $$PATH';\
0103                 false; \
0104         fi
0105         @if test ! -f "$(PALOCONF)"; then \
0106                 cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
0107                 echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
0108                 echo 'You should check it and re-run "make palo".'; \
0109                 echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
0110                 false; \
0111         fi
0112         $(PALO) -f $(PALOCONF)
0113 
0114 BOOT_TARGETS    = zImage Image palo lifimage
0115 INSTALL_TARGETS = zinstall install
0116 
0117 PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
0118 
0119 bzImage zImage: vmlinuz
0120 Image: vmlinux
0121 
0122 vmlinuz: vmlinux
0123         @gzip -cf -9 $< > $@
0124 
0125 install:
0126         $(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
0127                         $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
0128 zinstall:
0129         $(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
0130                         $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
0131 
0132 CLEAN_FILES     += lifimage
0133 MRPROPER_FILES  += palo.conf
0134 
0135 define archhelp
0136         @echo  '* vmlinux       - Uncompressed kernel image (./vmlinux)'
0137         @echo  '  vmlinuz       - Compressed kernel image (./vmlinuz)'
0138         @echo  '  palo          - Bootable image (./lifimage)'
0139         @echo  '  install       - Install uncompressed vmlinux kernel using'
0140         @echo  '                  (your) ~/bin/$(INSTALLKERNEL) or'
0141         @echo  '                  (distribution) /sbin/$(INSTALLKERNEL) or'
0142         @echo  '                  copy to $$(INSTALL_PATH)'
0143         @echo  '  zinstall      - Install compressed vmlinuz kernel'
0144 endef
0145 
0146 # we require gcc 3.3 or above to compile the kernel
0147 archprepare: checkbin
0148 checkbin:
0149         @if test "$(cc-version)" -lt "0303"; then \
0150                 echo -n "Sorry, GCC v3.3 or above is required to build " ; \
0151                 echo "the kernel." ; \
0152                 false ; \
0153         fi