--- zzzz-none-000/linux-2.4.17/Makefile 2001-12-21 17:41:53.000000000 +0000 +++ sangam-fb-401/linux-2.4.17/Makefile 2005-07-20 11:54:06.000000000 +0000 @@ -1,25 +1,43 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 17 -EXTRAVERSION = +EXTRAVERSION = $(shell if [ -f .hhl_target_lspname ]; then \ + echo "_mvl21-`cat .hhl_target_lspname`"; \ + else \ + echo "_mvl21"; \ + fi) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) +# ARCH := $(shell if [ -f .hhl_target_cpu ]; then \ +# cat .hhl_target_cpu; \ +# else \ +# uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/; \ +# fi) +ARCH := mips + KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//") CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi) + +SHELL := $(CONFIG_SHELL) TOPDIR := $(shell /bin/pwd) HPATH = $(TOPDIR)/include FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net -HOSTCC = gcc +HOSTCC = $(NATIVEPATH) gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = +# CROSS_COMPILE = $(shell if [ -f .hhl_cross_compile ]; then cat .hhl_cross_compile; fi) +HOSTOS=$(shell uname) +ifeq (${HOSTOS},SunOS) +TOOLDIR="" +else +TOOLDIR="/sbin/" +endif # # Include the make variables (CC, etc...) @@ -35,10 +53,12 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump MAKEFILES = $(TOPDIR)/.config -GENKSYMS = /sbin/genksyms -DEPMOD = /sbin/depmod +GENKSYMS = $(TOOLDIR)genksyms +DEPMOD = $(TOOLDIR)depmod MODFLAGS = -DMODULE -CFLAGS_KERNEL = +# Texas Instruments NSP3.2 - remove -g -ggdb flags to save memory +#CFLAGS_KERNEL = -g -ggdb +CFLAGS_KERNEL = PERL = perl export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ @@ -52,6 +72,9 @@ # "depend" the target if there is no top-level dependency information. # +#include .config +#include .depend + ifeq (.config,$(wildcard .config)) include .config ifeq (.depend,$(wildcard .depend)) @@ -66,6 +89,54 @@ do-it-all: config endif +DD = dd + +ifeq ($(CONFIG_MIPS_AR7VDB),y) +DD_BS = 128k +else +ifeq ($(CONFIG_MIPS_AR7DB),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_AR7RD),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_AR7WI),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_AR7V),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_AR7VWI),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_AR7WRD),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_SEAD2),y) +DD_BS = 256k +else +DD_BS = 256k +ifeq ($(CONFIG_MIPS_AR5D01),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_WLAN),y) +DD_BS = 64k +else +ifeq ($(CONFIG_MIPS_ACPEP),y) +DD_BS = 128k +else +DD_BS = 256k +endif +endif +endif +endif +endif +endif +endif +endif +endif +endif +endif # # INSTALL_PATH specifies where to place the updated kernel and system map # images. Uncomment if you want to place them anywhere other than root. @@ -75,21 +146,27 @@ # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory -# relocations required by build roots. This is not defined in the -# makefile but the arguement can be passed to make if needed. +# relocations required by build roots. # -MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) -export MODLIB +INSTALL_MOD_PATH := $(shell cd ../../..;pwd) +# texas ... +# MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) +# export MODLIB # # standard CFLAGS # +# Texas Instruments NSP3.2 - remove -g -ggdb flags to save memory +# DEBUG := -g -ggdb -fno-omit-frame-pointer +DEBUG := -fomit-frame-pointer + CPPFLAGS := -D__KERNEL__ -I$(HPATH) + +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ + -fno-strict-aliasing -fno-common $(DEBUG) -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ - -fomit-frame-pointer -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) # @@ -121,7 +198,7 @@ CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o NETWORKS =net/network.o -LIBS =$(TOPDIR)/lib/lib.a +LIBS =$(TOPDIR)/lib/lib.a SUBDIRS =kernel drivers mm fs net ipc lib DRIVERS-n := @@ -129,13 +206,22 @@ DRIVERS-m := DRIVERS- := +# DRIVERS-$(CONFIG_MIPS_AVALANCHE_ADAM2) += drivers/adam2/adam2.o +# DRIVERS-$(CONFIG_MIPS_AVALANCHE_ADAM2_JMP_TBL) += drivers/adam2/adam2.o +# DRIVERS-$(CONFIG_MIPS_AVALANCHE_TICFG) += drivers/ticfg/ticfg.o +#DRIVERS-$(CONFIG_MIPS_AVALANCHE_ADAM2) += drivers/adam2/adam2.o +#DRIVERS-$(CONFIG_MIPS_AVALANCHE_ADAM2_JMP_TBL) += drivers/adam2/adam2.o +#DRIVERS-$(CONFIG_MIPS_AVALANCHE_TICFG) += drivers/ticfg/ticfg.o + DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o +DRIVERS-$(CONFIG_L3) += drivers/l3/l3.o DRIVERS-y += drivers/char/char.o \ drivers/block/block.o \ drivers/misc/misc.o \ drivers/net/net.o \ drivers/media/media.o +DRIVERS-$(CONFIG_SERIAL_CORE) += drivers/serial/serial.o DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o DRIVERS-$(CONFIG_DRM) += drivers/char/drm/drm.o DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a @@ -156,6 +242,7 @@ DRIVERS-y += drivers/cdrom/driver.o endif +DRIVERS-$(CONFIG_SSI) += drivers/ssi/ssi.o DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o @@ -167,7 +254,7 @@ DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a -DRIVERS-$(CONFIG_ALL_PPC) += drivers/macintosh/macintosh.o +DRIVERS-$(CONFIG_PPC) += drivers/macintosh/macintosh.o DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a @@ -184,6 +271,12 @@ DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o +DRIVERS-$(CONFIG_MAPLE) += drivers/maple/maplebus.o +DRIVERS-$(CONFIG_TRACE) += drivers/trace/trace_driver.o +DRIVERS-$(CONFIG_VMEBUS) += drivers/vme/vme.o +DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensor.o +DRIVERS-$(CONFIG_TFFS) += drivers/tffs/tffs.o +DRIVERS-$(CONFIG_TFFS2) += drivers/tffs-2.0/tffs-2.0.o DRIVERS := $(DRIVERS-y) @@ -207,7 +300,9 @@ drivers/scsi/53c700-mem.c \ net/khttpd/make_times_h \ net/khttpd/times.h \ - submenu* + submenu* \ + ram_zimage.bin \ + ram_zimage.sre # directories removed with 'make clean' CLEAN_DIRS = \ modules @@ -257,6 +352,32 @@ boot: vmlinux @$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot +ifeq ($(CONFIG_MIPS_AVALANCHE_SOC),y) +INTEL_GCC = gcc +SREC2BIN = $(TOPDIR)/srec2bin +endif + + +ram_zimage: vmlinux srec2bin + $(MAKE) ram_zimage -C arch/$(ARCH)/mips-boards/ti_avalanche/inflater + $(SREC2BIN) ram_zimage.sre ram_zimage.bin +# echo -e "\x42\xFA\xED\xFE\c" >ram_zimage.bin +# cat ram_zimage.tmp >>ram_zimage.bin + +ram_zimage_pad: ram_zimage + $(DD) if=ram_zimage.bin of=ram_zimage_pad.bin bs=$(DD_BS) conv=sync + +acpep_copy: vmlinux srec2bin ram_zimage_pad + cp ram_zimage.bin /home/ftp/acpep/zimage + +evm_copy: vmlinux srec2bin ram_zimage_pad + cp ram_zimage.bin /home/ftp/evm3_1.2/zimage + +srec2bin: + @echo NATIVEPATH:$(NATIVEPATH) + $(NATIVEPATH) $(INTEL_GCC) -o srec2bin arch/$(ARCH)/mips-boards/ti_avalanche/inflater/srec2bin.c + + vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o linuxsubdirs $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o \ --start-group \ @@ -265,9 +386,16 @@ $(NETWORKS) \ $(LIBS) \ --end-group \ - -o vmlinux + -o vmlinux + cp vmlinux vmlinux.debug + $(STRIP) --strip-debug vmlinux $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map +ifdef DISASM_MIPS + $(OBJDUMP) --debugging --disassemble-all --line-numbers -EL --source -w vmlinux > vmlinux.dis +endif + + symlinks: rm -f include/asm ( cd include ; ln -sf asm-$(ARCH) asm) @@ -290,7 +418,8 @@ $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in include/config/MARKER: scripts/split-include include/linux/autoconf.h - scripts/split-include include/linux/autoconf.h include/config + scripts/split-include include/linux/autoconf.h include/config + scripts/split-include include/linux/nsp.h include/config @ touch include/config/MARKER linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS)) @@ -306,7 +435,14 @@ @mv -f .tmpversion .version include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion - @echo -n \#define UTS_VERSION \"\#`cat .version` > .ver + @rm -f .versvn + @(if svnversion . > .versvn; then \ + echo SVN Version is `cat .versvn`; \ + echo -n \#define UTS_VERSION \"\#`cat .versvn`-`cat .version` > .ver ;\ + else \ + echo Could not retrieve SVN version; \ + echo -n \#define UTS_VERSION \"\#`cat .version` > .ver ;\ + fi;) @if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver; fi @if [ -f .name ]; then echo -n \-`cat .name` >> .ver; fi @echo ' '`date`'"' >> .ver @@ -350,6 +486,17 @@ find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \ find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a +# Similar to 'tags' production rule except builds cscope db and assures +# that we use only headers for the current target. + +cscope: dummy + rm -f tags cscope.files ; \ + CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ + find include -type d \( -name "asm-*" -o -name "arch-*" -o -name "proc-*" -o -name config \) -prune \ + -o -follow -name '*.h' -print | tee -a cscope.files | xargs ctags $$CTAGSF -a && \ + find $(SUBDIRS) init -name '*.[Sch]' | tee -a cscope.files | xargs ctags $$CTAGSF -a && \ + cscope -k -b -I include + ifdef CONFIG_MODULES ifdef CONFIG_MODVERSIONS MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h @@ -384,7 +531,9 @@ endif .PHONY: _modinst_post _modinst_post: _modinst_post_pcmcia - if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi + if [ "$(CROSS_COMPILE)" = "" ]; then \ + if [ -r System.map ]; then \ + $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE);fi;fi # Backwards compatibilty symlinks for people still using old versions # of pcmcia-cs with hard coded pathnames on insmod. Remove @@ -417,6 +566,10 @@ rm -f $(CLEAN_FILES) rm -rf $(CLEAN_DIRS) $(MAKE) -C Documentation/DocBook clean +ifeq ($(CONFIG_MIPS_AVALANCHE_SOC),y) + $(MAKE) -C arch/$(ARCH)/mips-boards/ti_avalanche/inflater clean +endif + mrproper: clean archmrproper find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f @@ -428,10 +581,10 @@ rm -f core `find . \( -not -type d \) -and \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ - -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags cscope.* backup: mrproper - cd .. && tar cf - linux/ | gzip -9 > backup.gz + cd .. && tar cf - linux-2.4.17_mvl21/ | gzip -9 > backup.gz sync sgmldocs: @@ -454,7 +607,7 @@ dep-files: scripts/mkdep archdep include/linux/version.h scripts/mkdep -- init/*.c > .depend - scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend + ( find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- ) > .hdepend $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ifdef CONFIG_MODVERSIONS $(MAKE) update-modverfile @@ -536,3 +689,11 @@ . scripts/mkversion > .version ; \ rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \ rm $(TOPDIR)/../$(KERNELPATH).tar.gz + +defconfig: + cp arch/$(ARCH)/defconfig .config + +#--------------------------------------------------------------------------- +# vim: noexpandtab +#--------------------------------------------------------------------------- +# DO NOT DELETE