import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / parisc / Makefile
1 #
2 # parisc/Makefile
3 #
4 # This file is included by the global makefile so that you can add your own
5 # architecture-specific flags and dependencies. Remember to do have actions
6 # for "archclean" and "archdep" for cleaning up and making dependencies for
7 # this architecture
8 #
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License.  See the file "COPYING" in the main directory of this archive
11 # for more details.
12 #
13 # Copyright (C) 1994 by Linus Torvalds
14 # Portions Copyright (C) 1999 The Puffin Group
15 #
16 # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
17 # Mike Shaver, Helge Deller and Martin K. Petersen
18 #
19
20 ifdef CONFIG_PARISC64
21 LINKFLAGS =-T $(TOPDIR)/arch/parisc/vmlinux64.lds $(LDFLAGS)
22 CROSS_COMPILE := hppa64-linux-
23 UTS_MACHINE := parisc64
24 #CFLAGS += -b hppa64-linux
25
26 else
27 LINKFLAGS =-T $(TOPDIR)/arch/parisc/vmlinux.lds $(LDFLAGS)
28 MACHINE := $(subst 64,,$(shell uname -m))
29 ifneq (${MACHINE},parisc)
30 # cross compilation
31 CROSS_COMPILE := hppa-linux-
32 endif
33 endif
34
35 OFFSET_H := $(TOPDIR)/include/asm-parisc/offset.h
36 FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align 
37
38 CPP=$(CC) -E
39 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
40 LDFLAGS =
41
42
43 CFLAGS_PIPE := -pipe
44 CFLAGS_NSR  := -fno-strength-reduce
45 CFLAGS := $(CFLAGS) -D__linux__ $(CFLAGS_PIPE) $(CFLAGS_NSR)
46
47 # These should be on for older toolchains or SOM toolchains that don't
48 # enable them by default.
49 CFLAGS += -mno-space-regs -mfast-indirect-calls
50
51 # No fixed-point multiply
52 CFLAGS += -mdisable-fpregs
53
54 # Without this, "ld -r" results in .text sections that are too big
55 # (> 0x40000) for branches to reach stubs.
56 CFLAGS += -ffunction-sections
57
58 # select which processor to optimise for
59 ifdef CONFIG_PA7100
60 CFLAGS += -march=1.1 -mschedule=7100
61 endif
62
63 ifdef CONFIG_PA7200
64 CFLAGS += -march=1.1 -mschedule=7200
65 endif
66
67 ifdef CONFIG_PA7100LC
68 CFLAGS += -march=1.1 -mschedule=7100LC
69 endif
70
71 ifdef CONFIG_PA8X00
72 CFLAGS += -march=2.0 -mschedule=8000
73 endif
74
75 ASFLAGS := -D__ASSEMBLY__ -traditional
76
77 HEAD := arch/parisc/kernel/head.o 
78
79 SUBDIRS := $(SUBDIRS) $(addprefix arch/parisc/, tools kernel mm lib hpux)
80 CORE_FILES :=  $(addprefix arch/parisc/, kernel/pdc_cons.o kernel/process.o \
81         lib/lib.a mm/mm.o kernel/kernel.o hpux/hpux.o) \
82         $(CORE_FILES) arch/parisc/kernel/init_task.o
83 CLEAN_FILES := $(CLEAN_FILES) arch/parisc/tools/offset.[hs] 
84
85 ifdef CONFIG_PARISC64
86 HEAD := arch/parisc/kernel/head64.o
87 endif
88
89 LIBS := `$(CC) -print-libgcc-file-name` $(TOPDIR)/arch/parisc/lib/lib.a $(LIBS) 
90
91 SUBDIRS := $(SUBDIRS) arch/parisc/math-emu
92 DRIVERS := $(DRIVERS) arch/parisc/math-emu/math.o
93
94 arch/parisc/kernel: dummy
95         $(MAKE) linuxsubdirs SUBDIRS=arch/parisc/kernel
96
97 arch/parisc/mm: dummy
98         $(MAKE) linuxsubdirs SUBDIRS=arch/parisc/mm
99
100 palo: vmlinux
101         @if [ $$(palo -f /dev/null >/dev/null 2>&1 ; echo $$?) != 2 ]; then \
102                 echo 'ERROR: Please install palo first (apt-get install palo)';\
103                 echo 'or build it from source and install it somewhere in your $$PATH';\
104                 false; \
105         fi
106         @if [ ! -f ./palo.conf ]; then \
107                 cp arch/parisc/defpalo.conf palo.conf; \
108                 echo 'A generic palo config file (./palo.conf) has been created for you.'; \
109                 echo 'You should check it and re-run "make palo".'; \
110                 echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
111                 false; \
112         fi
113         palo -f ./palo.conf
114
115 oldpalo: vmlinux
116         export TOPDIR=`pwd`; \
117         unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
118
119 Image: palo
120
121 Image-clean:
122
123 ramdisk.o:
124
125 zImage: palo
126
127 bzImage: palo
128
129 compressed: zImage
130
131 install: 
132
133 archmrproper:
134         rm -f $(OFFSET_H)
135
136 archclean:
137
138 archdep: $(OFFSET_H)
139
140 $(OFFSET_H): include/linux/version.h
141         $(MAKE) -C $(TOPDIR)/arch/$(ARCH)/tools all
142
143 .PHONY: $(OFFSET_H)