source: branches/1.5/Makefile.in @ 555

Last change on this file since 555 was 555, checked in by dennis, 7 years ago

Preparing new release new version of SALI

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1#
2#       "SALI" 
3#
4#   Copyright (C) 2010 SARA Computing and Networking Services
5#   
6#   $Id: Makefile.in 555 2013-03-06 08:57:54Z dennis $
7#        vi: set filetype=make:
8#
9
10## BEGIN General options
11#
12VERSION=$(shell cat VERSION)
13
14ARCH=@ARCH@
15ARCH_BIT=@ARCH_BIT@
16OS=@OS@
17OS_RELEASE=@OS_RELEASE@
18
19ifeq ($(ARCH_BIT),64)
20        LIBDIR=lib64
21else
22        LIBDIR=lib
23endif
24
25RELEASE_DOCS = CHANGELOG LICENSE CREDITS README VERSION AUTHORS
26NCPUS=$(shell egrep -c '^processor' /proc/cpuinfo )
27#
28## END General options
29
30## BEGIN location options
31#
32ROOT_DIR=$(CURDIR)
33
34# TAR directory
35TAR_DIR=$(ROOT_DIR)/tar
36
37# EXAMPLE directory
38EXAMPLE_DIR=example
39
40# contrib directory
41CONTRIB_DIR=contrib
42
43# The basic
44SRC_DIR=$(ROOT_DIR)/src
45STAMP_DIR=$(SRC_DIR)
46
47# The kernel locations
48KERNEL_DIR=$(ROOT_DIR)/kernel
49KERNEL_MAKED_DIR=$(KERNEL_DIR)/make.d
50KERNEL_PATCH_DIR=$(KERNEL_DIR)/patches
51KERNEL_BUILD_DIR=$(KERNEL_DIR)/build_dir
52
53# The initrd locations
54INITRD_DIR=$(ROOT_DIR)/initrd
55INITRD_MAKED_DIR=$(INITRD_DIR)/make.d
56INITRD_PATCH_DIR=$(INITRD_DIR)/patches
57INITRD_BUILD_DIR=$(INITRD_DIR)/build_dir
58
59INITRD_BUILD_MAN_DIR=$(INITRD_BUILD_DIR)/usr/share/man
60INITRD_BUILD_BIN_DIR=$(INITRD_BUILD_DIR)/bin
61INITRD_BUILD_SBIN_DIR=$(INITRD_BUILD_DIR)/sbin
62#
63## END location options
64
65## BEGIN utilities
66#
67GETSOURCE=$(ROOT_DIR)/tools/getsource
68COPYLIBS=$(ROOT_DIR)/tools/copy_libs
69#
70## END utilities
71
72include $(KERNEL_MAKED_DIR)/kernel.rul
73include $(KERNEL_MAKED_DIR)/zlib.rul
74include $(INITRD_DIR)/initrd.rul
75
76# build everything, install nothing
77build:  tar_clean initrd_install kernel $(ROOT_DIR)/build
78
79tar_clean:
80        ( rm -rf $(TAR_DIR)/* )
81
82$(ROOT_DIR)/build:
83
84        ( mkdir -p -m 0755 $(TAR_DIR)/sali-$(VERSION)/$(ARCH) )
85
86        ( make INSTALL_MOD_PATH=$(INITRD_BUILD_DIR) -C $(LINUX_DIR) modules_install )
87
88        ## make the binaries smaller
89        #
90        strip $(INITRD_BINARIES)
91
92        ( cd "$(INITRD_BUILD_DIR)" && find . | cpio --quiet -o -H newc > "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/initrd" )
93        ( cd "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)" && bzip2 --best --force initrd && mv initrd.bz2 initrd.img )
94        ( cp "$(LINUX_IMAGE)" "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/kernel" )
95
96
97ifeq ($(OS),suse)
98        ( cp "$(LINUX_DIR)/vmlinux" "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/vmlinux" )
99        mkzimage --vmlinux "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/vmlinux" --initrd "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/initrd.img" --output "$(TAR_DIR)/sali-$(VERSION)/$(ARCH)/vmlinuz"
100endif
101
102        $(foreach doc, $(RELEASE_DOCS), cp $(ROOT_DIR)/$(doc) $(TAR_DIR)/sali-$(VERSION)/$(doc);)
103
104        cp -a $(ROOT_DIR)/$(EXAMPLE_DIR) $(TAR_DIR)/sali-$(VERSION)
105        rm -rf $(TAR_DIR)/sali-$(VERSION)/$(EXAMPLE_DIR)/.svn
106        rm -rf $(TAR_DIR)/sali-$(VERSION)/$(EXAMPLE_DIR)/post-install/.svn
107
108        cp -a $(ROOT_DIR)/$(CONTRIB_DIR) $(TAR_DIR)/sali-$(VERSION)
109        rm -rf $(TAR_DIR)/sali-$(VERSION)/$(CONTRIB_DIR)/.svn
110
111        mkdir -p $(TAR_DIR)/sali-$(VERSION)/bootdisk
112        mkdir -p $(TAR_DIR)/sali-$(VERSION)/bootdisk/kernel
113        mkdir -p $(TAR_DIR)/sali-$(VERSION)/bootdisk/images
114        cp -a $(ROOT_DIR)/bootdisk/isolinux $(TAR_DIR)/sali-$(VERSION)/bootdisk/isolinux
115        cp -a $(ROOT_DIR)/bootdisk/sali_create_bootdisk $(TAR_DIR)/sali-$(VERSION)/bootdisk
116        chmod +x $(TAR_DIR)/sali-$(VERSION)/bootdisk/sali_create_bootdisk
117
118        cp -a $(ROOT_DIR)/server $(TAR_DIR)/sali-$(VERSION)
119        find $(TAR_DIR) -type d -name .svn | xargs rm -r
120
121        touch $@
122
123tarball: build
124        cd $(TAR_DIR) && tar -pczf $(ROOT_DIR)/sali-$(ARCH)-$(VERSION).tar.gz *
125
126.PHONY: help
127help:  show_targets
128
129.PHONY: clean
130clean:
131        @echo "Removing file for tar distribution"
132        rm -f $(ROOT_DIR)/build
133        rm -rf $(TAR_DIR)
134   
135
136.PHONY: distclean
137distclean: initrd_clean clean
138
139        @echo "Removing all generated and downloaded files"
140        rm -rf $(ROOT_DIR)/src
141        rm -f Makefile config.log config.status initrd/sali/bin/sali_functions initrd/functions/functions.mbm bootdisk/sali_create_bootdisk server/setup.py
142
143.PHONY: show_targets
144show_targets:
145        @echo
146        @echo "General commands:"
147        @echo " build"
148        @echo "    Build everything."
149        @echo " kernel"
150        @echo "    Only build the kernel."
151        @echo " initrd"
152        @echo "    Builds the software for the initrd, skips kernel build!"
153        @echo " tarball"
154        @echo "    Make a tarball with the contents from ROOT_DIR/build."
155        @echo
156        @echo "Dynamic commands (available when imported in initrd.rul):"
157        @echo " <name>"
158        @echo "    Retrieve and build the .rul package in the directory $(SRC_DIR)"
159        @echo " <name>_install"
160        @echo "    Installs the .rul package to $(INITRD_BUILD_DIR)"
161        @echo " <name>_clean"
162        @echo "    Cleans the files of a .rul package in $(SRC_DIR)"
163
164all: show_targets
Note: See TracBrowser for help on using the repository browser.