]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/grub
make.sh: Build popt earlier
[ipfire-2.x.git] / lfs / grub
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
20406699 4# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
20406699 27VER = 2.02
cd1a2927
MT
28
29THISAPP = grub-$(VER)
f5bfed65 30DL_FILE = $(THISAPP).tar.xz
c7845ac1 31DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
ebf9683b 34SUP_ARCH = x86_64 i586
f5bfed65 35
308af080
MT
36# Build for which platforms?
37BUILD_PC = 1
38BUILD_EFI = $(EFI)
784cd5cb 39
308af080
MT
40DIR_APP_PC = $(DIR_APP)-pc
41DIR_APP_EFI = $(DIR_APP)-efi
7fbbd2ae 42
308af080
MT
43# Don't use our CFLAGS for boot code
44export HOST_CFLAGS = $(CFLAGS)
45export HOST_LDFLAGS = $(LDFLAGS)
cd1a2927 46
784cd5cb
MT
47CONFIGURE_ARGS = \
48 --prefix=/usr \
49 --sysconfdir=/etc \
308af080 50 --disable-werror
784cd5cb 51
cd1a2927
MT
52###############################################################################
53# Top-level Rules
54###############################################################################
55
ed8977a1
SS
56objects = $(DL_FILE) \
57 unifont-7.0.03.pcf.gz
cd1a2927
MT
58
59$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
ed8977a1 60unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz
cd1a2927 61
20406699 62$(DL_FILE)_MD5 = 8a4a2a95aac551fb0fba860ceabfa1d3
ed8977a1 63unifont-7.0.03.pcf.gz_MD5 = f6903ac8c1caeeb30c1e9a2975028401
cd1a2927
MT
64
65install : $(TARGET)
66
67check : $(patsubst %,$(DIR_CHK)/%,$(objects))
68
69download :$(patsubst %,$(DIR_DL)/%,$(objects))
70
71md5 : $(subst %,%_MD5,$(objects))
72
73###############################################################################
74# Downloading, checking, md5sum
75###############################################################################
76
77$(patsubst %,$(DIR_CHK)/%,$(objects)) :
78 @$(CHECK)
79
80$(patsubst %,$(DIR_DL)/%,$(objects)) :
81 @$(LOAD)
82
83$(subst %,%_MD5,$(objects)) :
84 @$(MD5)
85
86###############################################################################
87# Installation Details
88###############################################################################
89
90$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
91 @$(PREBUILD)
784cd5cb 92 @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
784cd5cb 93
308af080
MT
94 # Install unifont
95 cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz
784cd5cb 96
308af080
MT
97ifeq "$(BUILD_EFI)" "1"
98 cp -r $(DIR_APP) $(DIR_APP_EFI)
99 cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \
100 --with-platform=efi CFLAGS= LDFLAGS=
101 cd $(DIR_APP_EFI) && make $(MAKETUNING)
784cd5cb 102 cd $(DIR_APP_EFI) && make install
784cd5cb
MT
103endif
104
308af080
MT
105ifeq "$(BUILD_PC)" "1"
106 cp -r $(DIR_APP) $(DIR_APP_PC)
107 cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \
108 --with-platform=pc CFLAGS= LDFLAGS=
109 cd $(DIR_APP_PC) && make $(MAKETUNING)
110 cd $(DIR_APP_PC) && make install
cd1a2927 111
308af080 112 # Install empty configuration file
f5bfed65
MT
113 -mkdir -pv /boot/grub
114 touch /boot/grub/grub.cfg
308af080
MT
115endif
116
117 # Install background image
3ef5dd98 118 install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png
cd1a2927 119
308af080 120 # Install default configuration
f5bfed65
MT
121 -mkdir -pv /etc/default
122 install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub
10af520f 123
5e00841d
MT
124 # Disable hardening.
125 paxctl -Cmpes /usr/sbin/grub-bios-setup /usr/sbin/grub-probe
126 paxctl -Cmpexs /usr/bin/grub-script-check
127
308af080 128 @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI)
cd1a2927 129 @$(POSTBUILD)