Blame view

arch/parisc/Makefile 4.57 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #
  # parisc/Makefile
  #
  # This file is included by the global makefile so that you can add your own
  # architecture-specific flags and dependencies. Remember to do have actions
  # for "archclean" and "archdep" for cleaning up and making dependencies for
  # this architecture
  #
  # This file is subject to the terms and conditions of the GNU General Public
  # License.  See the file "COPYING" in the main directory of this archive
  # for more details.
  #
  # Copyright (C) 1994 by Linus Torvalds
  # Portions Copyright (C) 1999 The Puffin Group
  #
  # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
  # Mike Shaver, Helge Deller and Martin K. Petersen
  #
c04f7ae2d   Adrian Bunk   [PARISC] move def...
19

594174d81   Helge Deller   parisc: switch to...
20
  KBUILD_IMAGE := vmlinuz
c04f7ae2d   Adrian Bunk   [PARISC] move def...
21
  KBUILD_DEFCONFIG := default_defconfig
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
  NM		= sh $(srctree)/arch/parisc/nm
  CHECKFLAGS	+= -D__hppa__=1
4c01acc01   James Bottomley   [PARISC] fix code...
24
  LIBGCC		= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25
26
  
  ifdef CONFIG_64BIT
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
28
  UTS_MACHINE	:= parisc64
  CHECKFLAGS	+= -D__LP64__=1 -m64
6880b0150   Helge Deller   parisc: make defa...
29
  CC_ARCHES	= hppa64
991b7d6e6   Kyle McMartin   [PARISC] Attempt ...
30
  else # 32-bit
6880b0150   Helge Deller   parisc: make defa...
31
  CC_ARCHES	= hppa hppa2.0 hppa1.1
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
32
  endif
6880b0150   Helge Deller   parisc: make defa...
33
34
35
36
37
38
39
  ifneq ($(SUBARCH),$(UTS_MACHINE))
  	ifeq ($(CROSS_COMPILE),)
  		CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
  		CROSS_COMPILE := $(call cc-cross-prefix, \
  			$(foreach a,$(CC_ARCHES), \
  			$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
  	endif
991b7d6e6   Kyle McMartin   [PARISC] Attempt ...
40
  endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
41
42
43
44
45
46
47
  
  OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
  
  cflags-y	:= -pipe
  
  # These flags should be implied by an hppa-linux configuration, but they
  # are not in gcc 3.2.
d26a7730b   John David Anglin   parisc: Only use ...
48
49
50
51
52
53
  cflags-y	+= -mno-space-regs
  
  # -mfast-indirect-calls is only relevant for 32-bit kernels.
  ifndef CONFIG_64BIT
  cflags-y	+= -mfast-indirect-calls
  endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
54
55
56
57
  
  # Currently we save and restore fpregs on all kernel entry/interruption paths.
  # If that gets optimized, we might need to disable the use of fpregs in the
  # kernel.
fa681a180   Randolph Chung   [PARISC] Disable ...
58
  cflags-y	+= -mdisable-fpregs
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
60
61
  
  # Without this, "ld -r" results in .text sections that are too big
  # (> 0x40000) for branches to reach stubs.
d75f054a2   Helge Deller   parisc: add ftrac...
62
63
64
  ifndef CONFIG_FUNCTION_TRACER
    cflags-y	+= -ffunction-sections
  endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
65

ec758f983   Helge Deller   parisc: add CONFI...
66
  # Use long jumps instead of long branches (needed if your linker fails to
cf71130d6   Helge Deller   parisc: disable -...
67
68
69
70
  # link a too big vmlinux executable). Not enabled for building modules.
  ifdef CONFIG_MLONGCALLS
  KBUILD_CFLAGS_KERNEL += -mlong-calls
  endif
ec758f983   Helge Deller   parisc: add CONFI...
71

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
72
  # select which processor to optimise for
766039022   Paul Bolle   parisc: rename "C...
73
  cflags-$(CONFIG_PA7000)		+= -march=1.1 -mschedule=7100
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
75
76
77
78
79
  cflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
  cflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
  cflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
  cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
  
  head-y			:= arch/parisc/kernel/head.o 
a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
80
  KBUILD_CFLAGS	+= $(cflags-y)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
81

481f93b67   Thomas Gleixner   parisc: Fix init_...
82
  kernel-y			:= mm/ kernel/ math-emu/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
83
84
  
  core-y	+= $(addprefix arch/parisc/, $(kernel-y))
4c01acc01   James Bottomley   [PARISC] fix code...
85
  libs-y	+= arch/parisc/lib/ $(LIBGCC)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
86
87
  
  drivers-$(CONFIG_OPROFILE)		+= arch/parisc/oprofile/
6525ee55b   Kyle McMartin   parisc: quiet pal...
88
  PALO := $(shell if (which palo 2>&1); then : ; \
5feb4f39a   Kyle McMartin   [PARISC] Restore ...
89
90
  	elif [ -x /sbin/palo ]; then echo /sbin/palo; \
  	fi)
f67d4033c   Kyle McMartin   [PARISC] Make pal...
91
92
93
  PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \
  	else echo $(obj)/palo.conf; \
  	fi)
b0756b5ad   Helge Deller   parisc: make "mak...
94
  palo lifimage: vmlinuz
f67d4033c   Kyle McMartin   [PARISC] Make pal...
95
  	@if test ! -x "$(PALO)"; then \
5feb4f39a   Kyle McMartin   [PARISC] Restore ...
96
97
98
99
  		echo 'ERROR: Please install palo first (apt-get install palo)';\
  		echo 'or build it from source and install it somewhere in your $$PATH';\
  		false; \
  	fi
f67d4033c   Kyle McMartin   [PARISC] Make pal...
100
101
102
  	@if test ! -f "$(PALOCONF)"; then \
  		cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \
  		echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \
5feb4f39a   Kyle McMartin   [PARISC] Restore ...
103
104
105
106
  		echo 'You should check it and re-run "make palo".'; \
  		echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
  		false; \
  	fi
f67d4033c   Kyle McMartin   [PARISC] Make pal...
107
  	$(PALO) -f $(PALOCONF)
5feb4f39a   Kyle McMartin   [PARISC] Restore ...
108

b0756b5ad   Helge Deller   parisc: make "mak...
109
110
111
112
113
114
  BOOT_TARGETS    = zImage Image palo lifimage
  INSTALL_TARGETS = zinstall install
  
  PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
  
  bzImage zImage: vmlinuz
594174d81   Helge Deller   parisc: switch to...
115
  Image: vmlinux
594174d81   Helge Deller   parisc: switch to...
116
117
118
  
  vmlinuz: vmlinux
  	@gzip -cf -9 $< > $@
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
119

b0756b5ad   Helge Deller   parisc: make "mak...
120
121
122
123
124
125
  install:
  	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
  			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
  zinstall:
  	$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
  			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
126

0013a8545   Sam Ravnborg   kbuild: m68k,pari...
127
  CLEAN_FILES	+= lifimage
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
128
129
130
131
  MRPROPER_FILES	+= palo.conf
  
  define archhelp
  	@echo  '* vmlinux	- Uncompressed kernel image (./vmlinux)'
594174d81   Helge Deller   parisc: switch to...
132
  	@echo  '  vmlinuz	- Compressed kernel image (./vmlinuz)'
5feb4f39a   Kyle McMartin   [PARISC] Restore ...
133
  	@echo  '  palo		- Bootable image (./lifimage)'
b0756b5ad   Helge Deller   parisc: make "mak...
134
  	@echo  '  install	- Install uncompressed vmlinux kernel using'
caa27b66b   Sam Ravnborg   kbuild: use INSTA...
135
136
  	@echo  '		  (your) ~/bin/$(INSTALLKERNEL) or'
  	@echo  '		  (distribution) /sbin/$(INSTALLKERNEL) or'
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
137
  	@echo  '		  copy to $$(INSTALL_PATH)'
b0756b5ad   Helge Deller   parisc: make "mak...
138
  	@echo  '  zinstall	- Install compressed vmlinuz kernel'
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
139
  endef
991b7d6e6   Kyle McMartin   [PARISC] Attempt ...
140
141
142
143
  
  # we require gcc 3.3 or above to compile the kernel
  archprepare: checkbin
  checkbin:
665d92e38   Masahiro Yamada   kbuild: do not ad...
144
  	@if test "$(cc-version)" -lt "0303"; then \
991b7d6e6   Kyle McMartin   [PARISC] Attempt ...
145
146
147
148
  		echo -n "Sorry, GCC v3.3 or above is required to build " ; \
  		echo "the kernel." ; \
  		false ; \
  	fi