aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2018-01-27 14:50:21 -0900
committerDavid M. Syzdek <david@syzdek.net>2018-01-27 14:50:21 -0900
commit42d2385060f8c052d640b555e8fc3156415d5057 (patch)
treee04deec1f6e36cc2d66c7fc51e047e34c9374c2e
parent5160cb15d246c29f14dc25dd40219b9e71e96bdc (diff)
downloadiperd-42d2385060f8c052d640b555e8fc3156415d5057.tar.gz
iperd-42d2385060f8c052d640b555e8fc3156415d5057.tar.bz2
iperd-42d2385060f8c052d640b555e8fc3156415d5057.tar.xz
iperd-42d2385060f8c052d640b555e8fc3156415d5057.zip
Makefile: moving syslinux specific targets to Makefile.syslinux
Moving syslinux specific targets and variables to an include file in order to declutter the main Makefile.
-rw-r--r--Makefile98
-rw-r--r--src/syslinux/Makefile.syslinux132
2 files changed, 133 insertions, 97 deletions
diff --git a/Makefile b/Makefile
index 1757c33..d5c2630 100644
--- a/Makefile
+++ b/Makefile
@@ -39,11 +39,6 @@ SCRIPTDIR = src/scripts
39SYSLINDIR = src/syslinux 39SYSLINDIR = src/syslinux
40 40
41 41
42SYSLINUX_VERSION ?= 6.04-pre1
43#MIRROR_SYSLINUX ?= https://www.kernel.org/pub/linux/utils/boot/syslinux/6.xx/syslinux-$(SYSLINUX_VERSION).tar.xz
44MIRROR_SYSLINUX ?= https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/syslinux-6.04-pre1.tar.xz
45
46
47IPERD_VERSION = $(shell git describe --long --abbrev=7 HEAD |sed -e 's/\-/./g' -e 's/^v//g') 42IPERD_VERSION = $(shell git describe --long --abbrev=7 HEAD |sed -e 's/\-/./g' -e 's/^v//g')
48DATE = $(shell date +%Y-%m-%d) 43DATE = $(shell date +%Y-%m-%d)
49 44
@@ -156,6 +151,7 @@ NETBOOT_TFTP_PATH ?= /
156NETBOOT_TFTP ?= tftp://$(NETBOOT_TFTP_HOST)$(NETBOOT_TFTP_PATH) 151NETBOOT_TFTP ?= tftp://$(NETBOOT_TFTP_HOST)$(NETBOOT_TFTP_PATH)
157NETBOOT ?= $(NETBOOT_HTTP) 152NETBOOT ?= $(NETBOOT_HTTP)
158-include Makefile.config 153-include Makefile.config
154include src/syslinux/Makefile.syslinux
159 155
160 156
161images/iperdboot.gpt.img: $(PREREQ_CNF) $(DOWNLOAD_FILES) $(SCRIPTDIR)/diskimage.sh $(SCRIPTDIR)/thumbdrive.sh 157images/iperdboot.gpt.img: $(PREREQ_CNF) $(DOWNLOAD_FILES) $(SCRIPTDIR)/diskimage.sh $(SCRIPTDIR)/thumbdrive.sh
@@ -179,11 +175,6 @@ images/iperdboot.mbr.img: $(PREREQ_CNF) $(DOWNLOAD_FILES) $(SCRIPTDIR)/diskimage
179 @touch "$(@)" 175 @touch "$(@)"
180 176
181 177
182syslinux/isolinux.bin.mod: $(PREREQ_CNF)
183 cp syslinux/isolinux.bin "$(@)"
184 @touch "$(@)"
185
186
187images/iperdboot.iso: $(DOWNLOAD_FILES) syslinux/isolinux.bin.mod 178images/iperdboot.iso: $(DOWNLOAD_FILES) syslinux/isolinux.bin.mod
188 @mkdir -p $$(dirname "$(@)") 179 @mkdir -p $$(dirname "$(@)")
189 @rm -f "$(@)" 180 @rm -f "$(@)"
@@ -212,93 +203,6 @@ thumbdrive: $(PREREQ_CNF) $(DOWNLOAD_FILES)
212images: images/iperdboot.$(DISKTYPE).img images/iperdboot.iso 203images: images/iperdboot.$(DISKTYPE).img images/iperdboot.iso
213 204
214 205
215tmp/src/syslinux-$(SYSLINUX_VERSION)/.iperd-extracted:
216 ./src/scripts/download.sh \
217 tmp/src/syslinux-$(SYSLINUX_VERSION).tar.xz \
218 $(MIRROR_SYSLINUX)
219 cd tmp/src && tar -xf syslinux-$(SYSLINUX_VERSION).tar.xz
220 touch $(@)
221
222
223syslinux/iperd.dep: tmp/src/syslinux-$(SYSLINUX_VERSION)/.iperd-extracted
224 rm -Rf syslinux
225 rm -Rf EFI
226 cd tmp/src/syslinux-$(SYSLINUX_VERSION); \
227 make -s install INSTALLROOT="$(PWD)/tmp/syslinux" \
228 || { rm -Rf tmp/src/syslinux-$(SYSLINUX_VERSION); exit 1; }
229 rsync -ra "$(PWD)/tmp/syslinux/usr/share/syslinux/" syslinux
230 rsync -ra "$(PWD)/tmp/syslinux/usr/bin/" syslinux/bin
231 rsync -ra "$(PWD)/tmp/syslinux/sbin/" syslinux/sbin
232 cp $(SYSLINDIR)/f1.txt syslinux/
233 cp $(SYSLINDIR)/f2.txt syslinux/
234 cp $(SYSLINDIR)/lpxelinux.cfg syslinux/
235 cp $(SYSLINDIR)/efi32/pxelinux.cfg syslinux/efi32/
236 cp $(SYSLINDIR)/efi64/pxelinux.cfg syslinux/efi64/
237 cp /usr/share/hwdata/pci.ids syslinux/
238 cp /lib/modules/$$(uname -r)/modules.alias syslinux/modules.als
239 @touch "$(@)"
240
241
242EFI/BOOT/syslia32.cfg: src/syslinux/syslia32.cfg
243 @mkdir -p $$(dirname $(@))
244 cp src/syslinux/syslia32.cfg $(@)
245 @touch $(@)
246
247
248EFI/BOOT/syslx64.cfg: src/syslinux/syslx64.cfg
249 @mkdir -p $$(dirname $(@))
250 cp src/syslinux/syslx64.cfg $(@)
251 @touch $(@)
252
253
254EFI/BOOT/BOOTX64.EFI EFI/BOOT/BOOTX64.EFI.0: syslinux/iperd.dep
255 @mkdir -p $$(dirname $(@))
256 cp syslinux/efi64/syslinux.efi $(@)
257 @touch $(@)
258
259
260EFI/BOOT/BOOTIA32.EFI EFI/BOOT/BOOTIA32.EFI.0: syslinux/iperd.dep
261 @mkdir -p $$(dirname $(@))
262 cp syslinux/efi32/syslinux.efi $(@)
263 @touch $(@)
264
265
266EFI/BOOT/ldlinux.e32 ldlinux.e32: syslinux/iperd.dep
267 @mkdir -p $$(dirname $(@))
268 cp syslinux/efi32/ldlinux.e32 $(@)
269 @touch $(@)
270
271
272EFI/BOOT/ldlinux.e64 ldlinux.e64: syslinux/iperd.dep
273 @mkdir -p $$(dirname $(@))
274 cp syslinux/efi64/ldlinux.e64 $(@)
275 @touch $(@)
276
277
278syslinux/isolinux.cfg: Makefile.config $(ISOLINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
279 @rm -f "$(@)"
280 @mkdir -p "$$(dirname "$(@)")"
281 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(ISOLINUX_CFG) > $(@)'
282 @$(do_subst) $(SYSLINDIR)/common.cfg $(ISOLINUX_CFG) > "$(@)"
283 @touch "$(@)"
284
285
286syslinux/pxelinux.cfg: Makefile.config $(PXELINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
287 @rm -f "$(@)"
288 @mkdir -p "$$(dirname "$(@)")"
289 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(PXELINUX_CFG) > $(@)'
290 @$(do_subst) $(SYSLINDIR)/common.cfg $(PXELINUX_CFG) > "$(@)"
291 @touch "$(@)"
292
293
294syslinux/syslinux.cfg: Makefile.config $(SYSLINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
295 @rm -f "$(@)"
296 @mkdir -p syslinux
297 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(SYSLINUX_CFG) > $(@)'
298 @$(do_subst) $(SYSLINDIR)/common.cfg $(SYSLINUX_CFG) > "$(@)"
299 @touch "$(@)"
300
301
302syslinux: $(PREREQ_CNF) 206syslinux: $(PREREQ_CNF)
303 207
304 208
diff --git a/src/syslinux/Makefile.syslinux b/src/syslinux/Makefile.syslinux
new file mode 100644
index 0000000..4a49898
--- /dev/null
+++ b/src/syslinux/Makefile.syslinux
@@ -0,0 +1,132 @@
1#
2# IP Engineering Rescue Disk
3# Copyright (C) 2017 David M. Syzdek <david@syzdek.net>.
4#
5# @SYZDEK_BSD_LICENSE_START@
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are
9# met:
10#
11# * Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer.
13# * Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution.
16# * Neither the name of David M. Syzdek nor the
17# names of its contributors may be used to endorse or promote products
18# derived from this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30# SUCH DAMAGE.
31#
32# @SYZDEK_BSD_LICENSE_END@
33#
34
35
36SYSLINUX_VERSION ?= 6.04-pre1
37MIRROR_SYSLINUX ?= https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/syslinux-6.04-pre1.tar.xz
38
39
40syslinux/isolinux.bin.mod: $(PREREQ_CNF)
41 cp syslinux/isolinux.bin "$(@)"
42 @touch "$(@)"
43
44
45tmp/src/syslinux-$(SYSLINUX_VERSION)/.iperd-extracted:
46 ./src/scripts/download.sh \
47 tmp/src/syslinux-$(SYSLINUX_VERSION).tar.xz \
48 $(MIRROR_SYSLINUX)
49 cd tmp/src && tar -xf syslinux-$(SYSLINUX_VERSION).tar.xz
50 touch $(@)
51
52
53syslinux/iperd.dep: tmp/src/syslinux-$(SYSLINUX_VERSION)/.iperd-extracted
54 rm -Rf syslinux
55 rm -Rf EFI
56 cd tmp/src/syslinux-$(SYSLINUX_VERSION); \
57 make -s install INSTALLROOT="$(PWD)/tmp/syslinux" \
58 || { rm -Rf tmp/src/syslinux-$(SYSLINUX_VERSION); exit 1; }
59 rsync -ra "$(PWD)/tmp/syslinux/usr/share/syslinux/" syslinux
60 rsync -ra "$(PWD)/tmp/syslinux/usr/bin/" syslinux/bin
61 rsync -ra "$(PWD)/tmp/syslinux/sbin/" syslinux/sbin
62 cp $(SYSLINDIR)/f1.txt syslinux/
63 cp $(SYSLINDIR)/f2.txt syslinux/
64 cp $(SYSLINDIR)/lpxelinux.cfg syslinux/
65 cp $(SYSLINDIR)/efi32/pxelinux.cfg syslinux/efi32/
66 cp $(SYSLINDIR)/efi64/pxelinux.cfg syslinux/efi64/
67 cp /usr/share/hwdata/pci.ids syslinux/
68 cp /lib/modules/$$(uname -r)/modules.alias syslinux/modules.als
69 @touch "$(@)"
70
71
72EFI/BOOT/syslia32.cfg: src/syslinux/syslia32.cfg
73 @mkdir -p $$(dirname $(@))
74 cp src/syslinux/syslia32.cfg $(@)
75 @touch $(@)
76
77
78EFI/BOOT/syslx64.cfg: src/syslinux/syslx64.cfg
79 @mkdir -p $$(dirname $(@))
80 cp src/syslinux/syslx64.cfg $(@)
81 @touch $(@)
82
83
84EFI/BOOT/BOOTX64.EFI EFI/BOOT/BOOTX64.EFI.0: syslinux/iperd.dep
85 @mkdir -p $$(dirname $(@))
86 cp syslinux/efi64/syslinux.efi $(@)
87 @touch $(@)
88
89
90EFI/BOOT/BOOTIA32.EFI EFI/BOOT/BOOTIA32.EFI.0: syslinux/iperd.dep
91 @mkdir -p $$(dirname $(@))
92 cp syslinux/efi32/syslinux.efi $(@)
93 @touch $(@)
94
95
96EFI/BOOT/ldlinux.e32 ldlinux.e32: syslinux/iperd.dep
97 @mkdir -p $$(dirname $(@))
98 cp syslinux/efi32/ldlinux.e32 $(@)
99 @touch $(@)
100
101
102EFI/BOOT/ldlinux.e64 ldlinux.e64: syslinux/iperd.dep
103 @mkdir -p $$(dirname $(@))
104 cp syslinux/efi64/ldlinux.e64 $(@)
105 @touch $(@)
106
107
108syslinux/isolinux.cfg: Makefile.config $(ISOLINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
109 @rm -f "$(@)"
110 @mkdir -p "$$(dirname "$(@)")"
111 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(ISOLINUX_CFG) > $(@)'
112 @$(do_subst) $(SYSLINDIR)/common.cfg $(ISOLINUX_CFG) > "$(@)"
113 @touch "$(@)"
114
115
116syslinux/pxelinux.cfg: Makefile.config $(PXELINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
117 @rm -f "$(@)"
118 @mkdir -p "$$(dirname "$(@)")"
119 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(PXELINUX_CFG) > $(@)'
120 @$(do_subst) $(SYSLINDIR)/common.cfg $(PXELINUX_CFG) > "$(@)"
121 @touch "$(@)"
122
123
124syslinux/syslinux.cfg: Makefile.config $(SYSLINUX_CFG) $(PREREQ_BIN) $(SYSLINDIR)/common.cfg
125 @rm -f "$(@)"
126 @mkdir -p syslinux
127 @echo 'do_subst $$(SYSLINDIR)/common.cfg $$(SYSLINUX_CFG) > $(@)'
128 @$(do_subst) $(SYSLINDIR)/common.cfg $(SYSLINUX_CFG) > "$(@)"
129 @touch "$(@)"
130
131
132# end of makefile