summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gaugler <thomas@dadie.net>2019-04-07 00:01:25 +0200
committerThomas Gaugler <thomas@dadie.net>2019-04-07 00:20:30 +0200
commitf4f71954c54a74d2458a5843ad2142d3a5057d69 (patch)
treef63475416b3af191bcd4929b35eee620f336eb47
parent7e11b4ca125b5a359db7ebf0fd02eec89f0d774b (diff)
Place build artifacts into a dedicated directory
-rw-r--r--Makefile169
-rw-r--r--branding.nsi2
-rwxr-xr-xdebian/rules34
-rw-r--r--l10n/Makefile40
-rw-r--r--main.nsi12
-rw-r--r--onInit.nsi2
-rw-r--r--s_install.nsi16
7 files changed, 163 insertions, 112 deletions
diff --git a/Makefile b/Makefile
index 68a26bc..5f67af0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
-
export SHELL := bash
+BUILD_DIR ?= build
+MKDIR_P := mkdir -p
+RMDIR := rmdir
+
# Targets that will always be run (as they depend on stuff from installed packages)
-.PHONY: core.img g2ldr g2ldr.mbr loadlin.pif loadlin.exe pxe.lkrn
+.PHONY: $(BUILD_DIR)/core.img $(BUILD_DIR)/g2ldr $(BUILD_DIR)/g2ldr.mbr $(BUILD_DIR)/loadlin.pif $(BUILD_DIR)/loadlin.exe $(BUILD_DIR)/pxe.lkrn
PACKAGE := win32-loader
VERSION := $(shell head -n 1 debian/changelog | sed -e "s/^$(PACKAGE) (\(.*\)).*/\1/g")
@@ -27,9 +30,10 @@ MAKENSIS := makensis -V3
# Add to it some version'ing and date
MAKENSIS += -DVERSION=$(VERSION) -D4DIGITS_DATE=$(FOUR_DIGITS_DATE)
-ifdef OUTFILE_NAME
-MAKENSIS += -D_OUTFILE_NAME=$(OUTFILE_NAME)
+ifndef OUTFILE_NAME
+OUTFILE_NAME := $(BUILD_DIR)/win32-loader.exe
endif
+MAKENSIS += -D_OUTFILE_NAME=$(OUTFILE_NAME) -DBUILD_DIR=$(BUILD_DIR)
# Distributor/Company name (defaults to "The Debian Project")
ifdef COMPANY_NAME
@@ -97,28 +101,31 @@ ifdef PXE
GRUB_MODULES += linux16
endif
-all: win32-loader.exe g2ldr g2ldr.mbr
+all: $(OUTFILE_NAME) $(BUILD_DIR)/g2ldr $(BUILD_DIR)/g2ldr.mbr
+
+$(BUILD_DIR):
+ $(MKDIR_P) $(BUILD_DIR)
core.img:
grub-mkimage --output=$@ --prefix=/win32-loader --format=i386-pc $(GRUB_MODULES)
-g2ldr: /usr/lib/grub/i386-pc/g2hdr.bin core.img
+$(BUILD_DIR)/g2ldr: /usr/lib/grub/i386-pc/g2hdr.bin core.img | $(BUILD_DIR)
cat $^ > $@
-g2ldr.mbr: /usr/lib/grub/i386-pc/g2ldr.mbr
+$(BUILD_DIR)/g2ldr.mbr: /usr/lib/grub/i386-pc/g2ldr.mbr | $(BUILD_DIR)
cp $^ $@
-loadlin.pif: genpif
+$(BUILD_DIR)/loadlin.pif: genpif | $(BUILD_DIR)
bash $^ > $@
-loadlin.exe: /usr/lib/loadlin/loadlin.exe.gz
+$(BUILD_DIR)/loadlin.exe: /usr/lib/loadlin/loadlin.exe.gz | $(BUILD_DIR)
gunzip -c $^ > $@
-pxe.lkrn: /usr/lib/ipxe/ipxe.lkrn
+$(BUILD_DIR)/pxe.lkrn: /usr/lib/ipxe/ipxe.lkrn | $(BUILD_DIR)
cp $^ $@
ifdef PXE
-PXE_TARGETS = pxe.lkrn templates/ternary_choice.ini
+PXE_TARGETS = $(BUILD_DIR)/pxe.lkrn templates/ternary_choice.ini
else
PXE_TARGETS =
endif
@@ -127,112 +134,136 @@ templates/gtk.bmp: templates/gtk_orig.png
convert $^ -resize 107x80 BMP3:$@
# Build icons out of the SVG source, force them being square
-icon/swirl-%.png: icon/swirl.svg
+$(BUILD_DIR)/icon/swirl-%.png: icon/swirl.svg
+ $(MKDIR_P) $(BUILD_DIR)/icon
rsvg-convert -f png -h $* -w $* $^ > $@
# Build the icon out of the PNG icons
-win32-loader.ico: $(ICONSIZES:%=icon/swirl-%.png)
+$(BUILD_DIR)/win32-loader.ico: $(ICONSIZES:%=$(BUILD_DIR)/icon/swirl-%.png)
icotool -c -o $@ $^
-win32-loader.exe: main.nsi maps.ini \
+$(OUTFILE_NAME): main.nsi maps.ini \
templates/binary_choice.ini templates/graphics.ini templates/custom.ini templates/4_choices.ini \
templates/gtk.bmp templates/text.bmp \
- plugins/cpuid/test64.dll plugins/systeminfo/systeminfo.dll plugins/string.dll \
- plugins/libgcrypt_hash.dll \
- $(PXE_TARGETS) \
- win32-loader.ico loadlin.pif loadlin.exe g2ldr g2ldr.mbr
+ $(BUILD_DIR)/plugins/cpuid/test64.dll \
+ $(BUILD_DIR)/plugins/systeminfo/systeminfo.dll \
+ $(BUILD_DIR)/plugins/string.dll \
+ $(BUILD_DIR)/plugins/libgcrypt_hash.dll \
+ $(PXE_TARGETS) $(BUILD_DIR)/win32-loader.ico \
+ $(BUILD_DIR)/loadlin.pif $(BUILD_DIR)/loadlin.exe \
+ $(BUILD_DIR)/g2ldr $(BUILD_DIR)/g2ldr.mbr
find $^ -newermt "@$(SOURCE_DATE_EPOCH)" -print0 | xargs -0r touch --date="@$(SOURCE_DATE_EPOCH)"
- $(MAKE) -C l10n
+ $(MKDIR_P) $(BUILD_DIR)/l10n
+ $(MAKE) -C $(BUILD_DIR)/l10n -f $(CURDIR)/l10n/Makefile VPATH=$(CURDIR)/l10n
$(MAKENSIS) main.nsi
-ifndef OUTFILE_NAME
- du -h win32-loader.exe
-else
du -h $(OUTFILE_NAME)
-endif
-plugins/cpuid/test64.dll: plugins/cpuid/cpuid.c plugins/cpuid/plugin.c
+$(BUILD_DIR)/plugins:
+ $(MKDIR_P) $@
+
+$(BUILD_DIR)/plugins/cpuid/test64.dll: plugins/cpuid/cpuid.c plugins/cpuid/plugin.c
+ $(MKDIR_P) $(dir $@)
$(NSIS_CC) $^ $(NSIS_CFLAGS) -shared -o $@
$(NSIS_STRIP) $@
-plugins/systeminfo/systeminfo.dll: plugins/systeminfo/systeminfo.c
+$(BUILD_DIR)/plugins/systeminfo/systeminfo.dll: plugins/systeminfo/systeminfo.c
+ $(MKDIR_P) $(dir $@)
$(NSIS_CC) $^ $(NSIS_CFLAGS) -shared -o $@
$(NSIS_STRIP) $@
-plugins/string.dll: plugins/string.c
+$(BUILD_DIR)/plugins/string.dll: plugins/string.c | $(BUILD_DIR)/plugins
$(NSIS_CC) $^ $(NSIS_CFLAGS) -shared -o $@
$(NSIS_STRIP) $@
-plugins/libgcrypt_hash.dll: plugins/libgcrypt_hash.c
+$(BUILD_DIR)/plugins/libgcrypt_hash.dll: plugins/libgcrypt_hash.c | $(BUILD_DIR)/plugins
$(NSIS_CC) $^ $(NSIS_CFLAGS) -shared -static-libgcc /usr/i686-w64-mingw32/lib/libgcrypt.a /usr/i686-w64-mingw32/lib/libgpg-error.a /usr/i686-w64-mingw32/lib/libwsock32.a -o $@
$(NSIS_STRIP) $@
-iso: stable.iso daily.iso
-stable.iso: \
- netboot/download-stable-stamp \
- netboot/stable/win32-loader.exe netboot/stable/g2ldr netboot/stable/g2ldr.mbr \
- netboot/stable/autorun.inf netboot/stable/win32-loader.ini \
- $(NULL)
- genisoimage -r -J -o $@ netboot/stable
-
-daily.iso: \
- netboot/download-daily-stamp \
- netboot/daily/win32-loader.exe netboot/daily/g2ldr netboot/daily/g2ldr.mbr \
- netboot/daily/autorun.inf netboot/daily/win32-loader.ini \
- $(NULL)
- genisoimage -r -J -o $@ netboot/daily
+iso: $(BUILD_DIR)/stable.iso $(BUILD_DIR)/daily.iso
+$(BUILD_DIR)/stable.iso: \
+ $(BUILD_DIR)/netboot/download-stable-stamp \
+ $(BUILD_DIR)/netboot/stable/win32-loader.exe \
+ $(BUILD_DIR)/netboot/stable/g2ldr \
+ $(BUILD_DIR)/netboot/stable/g2ldr.mbr \
+ $(BUILD_DIR)/netboot/stable/autorun.inf \
+ $(BUILD_DIR)/netboot/stable/win32-loader.ini \
+ $(NULL) | $(BUILD_DIR)
+ genisoimage -r -J -o $@ $(BUILD_DIR)/netboot/stable
+
+$(BUILD_DIR)/daily.iso: \
+ $(BUILD_DIR)/netboot/download-daily-stamp \
+ $(BUILD_DIR)/netboot/daily/win32-loader.exe \
+ $(BUILD_DIR)/netboot/daily/g2ldr $(BUILD_DIR)/netboot/daily/g2ldr.mbr \
+ $(BUILD_DIR)/netboot/daily/autorun.inf \
+ $(BUILD_DIR)/netboot/daily/win32-loader.ini \
+ $(NULL) | $(BUILD_DIR)
+ genisoimage -r -J -o $@ $(BUILD_DIR)/netboot/daily
BASE_URL=http://deb.debian.org/debian/dists/stable/main
-netboot/download-stable-stamp:
- mkdir -p netboot/stable/install.{386,amd}/gtk
+$(BUILD_DIR)/netboot/download-stable-stamp:
+ $(MKDIR_P) $(BUILD_DIR)/netboot/stable/install.{386,amd}/gtk
wget $(BASE_URL)/installer-i386/current/images/netboot/debian-installer/i386/linux \
- -O netboot/stable/install.386/vmlinuz
+ -O $(BUILD_DIR)/netboot/stable/install.386/vmlinuz
wget $(BASE_URL)/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz \
- -O netboot/stable/install.386/initrd.gz
+ -O $(BUILD_DIR)/netboot/stable/install.386/initrd.gz
wget $(BASE_URL)/installer-i386/current/images/netboot/gtk/debian-installer/i386/initrd.gz \
- -O netboot/stable/install.386/gtk/initrd.gz
+ -O $(BUILD_DIR)/netboot/stable/install.386/gtk/initrd.gz
wget $(BASE_URL)/installer-amd64/current/images/netboot/debian-installer/amd64/linux \
- -O netboot/stable/install.amd/vmlinuz
+ -O $(BUILD_DIR)/netboot/stable/install.amd/vmlinuz
wget $(BASE_URL)/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz \
- -O netboot/stable/install.amd/initrd.gz
+ -O $(BUILD_DIR)/netboot/stable/install.amd/initrd.gz
wget $(BASE_URL)/installer-amd64/current/images/netboot/gtk/debian-installer/amd64/initrd.gz \
- -O netboot/stable/install.amd/gtk/initrd.gz
+ -O $(BUILD_DIR)/netboot/stable/install.amd/gtk/initrd.gz
touch $@
-netboot/download-daily-stamp:
- mkdir -p netboot/daily/install.{386,amd}/gtk
+$(BUILD_DIR)/netboot/download-daily-stamp:
+ $(MKDIR_P) $(BUILD_DIR)/netboot/daily/install.{386,amd}/gtk
wget https://d-i.debian.org/daily-images/i386/daily/netboot/debian-installer/i386/linux \
- -O netboot/daily/install.386/vmlinuz
+ -O $(BUILD_DIR)/netboot/daily/install.386/vmlinuz
wget https://d-i.debian.org/daily-images/i386/daily/netboot/debian-installer/i386/initrd.gz \
- -O netboot/daily/install.386/initrd.gz
+ -O $(BUILD_DIR)/netboot/daily/install.386/initrd.gz
wget https://d-i.debian.org/daily-images/i386/daily/netboot/gtk/debian-installer/i386/initrd.gz \
- -O netboot/daily/install.386/gtk/initrd.gz
+ -O n$(BUILD_DIR)/etboot/daily/install.386/gtk/initrd.gz
wget https://d-i.debian.org/daily-images/amd64/daily/netboot/debian-installer/amd64/linux \
- -O netboot/daily/install.amd/vmlinuz
+ -O $(BUILD_DIR)/netboot/daily/install.amd/vmlinuz
wget https://d-i.debian.org/daily-images/amd64/daily/netboot/debian-installer/amd64/initrd.gz \
- -O netboot/daily/install.amd/initrd.gz
+ -O $(BUILD_DIR)/netboot/daily/install.amd/initrd.gz
wget https://d-i.debian.org/daily-images/amd64/daily/netboot/gtk/debian-installer/amd64/initrd.gz \
- -O netboot/daily/install.amd/gtk/initrd.gz
+ -O $(BUILD_DIR)/netboot/daily/install.amd/gtk/initrd.gz
touch $@
-netboot/stable/autorun.inf netboot/daily/autorun.inf: autorun.inf
- mkdir -p netboot/{stable,daily}
+$(BUILD_DIR)/netboot/stable/autorun.inf $(BUILD_DIR)/netboot/daily/autorun.inf: autorun.inf
+ $(MKDIR_P) $(BUILD_DIR)/netboot/{stable,daily}
todos < $< > $@
-netboot/stable/win32-loader.ini netboot/daily/win32-loader.ini: win32-loader.ini
- mkdir -p netboot/{stable,daily}
+
+$(BUILD_DIR)/netboot/stable/win32-loader.ini $(BUILD_DIR)/netboot/daily/win32-loader.ini: win32-loader.ini
+ $(MKDIR_P) $(BUILD_DIR)/netboot/{stable,daily}
todos < $< > $@
-netboot/stable/win32-loader.exe netboot/daily/win32-loader.exe: win32-loader.exe
- mkdir -p netboot/{stable,daily}
+$(BUILD_DIR)/netboot/stable/win32-loader.exe $(BUILD_DIR)/netboot/daily/win32-loader.exe: $(OUTFILE_NAME)
+ $(MKDIR_P) $(BUILD_DIR)/netboot/{stable,daily}
cp $^ $@
-netboot/stable/% netboot/daily/%: %
- mkdir -p netboot/{stable,daily}
+$(BUILD_DIR)/netboot/stable/% $(BUILD_DIR)/netboot/daily/%: $(BUILD_DIR)/%
+ $(MKDIR_P) $(BUILD_DIR)/netboot/{stable,daily}
cp $(shell basename $@) $@
clean:
- $(MAKE) -C l10n clean
- rm -f plugins/cpuid/*.dll plugins/cpuid/*.exe plugins/systeminfo/*.dll plugins/*.dll win32-loader.exe \
- *.iso *~ */*~ core.img g2ldr g2ldr.mbr loadlin.pif loadlin.exe pxe.lkrn icon/*.png win32-loader.ico
+ if [ -d $(BUILD_DIR)/l10n ]; then $(MAKE) -C $(BUILD_DIR)/l10n -f ../../l10n/Makefile clean; $(RMDIR) $(BUILD_DIR)/l10n; fi
+ rm -f $(BUILD_DIR)/plugins/cpuid/*.dll \
+ $(BUILD_DIR)/plugins/cpuid/*.exe \
+ $(BUILD_DIR)/plugins/systeminfo/*.dll \
+ $(BUILD_DIR)/plugins/*.dll $(OUTFILE_NAME) \
+ $(BUILD_DIR)/*.iso $(BUILD_DIR)/*~ $(BUILD_DIR)/*/*~ \
+ $(BUILD_DIR)/core.img \
+ $(BUILD_DIR)/g2ldr $(BUILD_DIR)/g2ldr.mbr \
+ $(BUILD_DIR)/loadlin.pif $(BUILD_DIR)/loadlin.exe \
+ $(BUILD_DIR)/pxe.lkrn $(BUILD_DIR)/icon/*.png \
+ $(BUILD_DIR)/win32-loader.ico
+ if [ -d $(BUILD_DIR)/icon ]; then $(RMDIR) $(BUILD_DIR)/icon; fi
+ if [ -d $(BUILD_DIR)/plugins/cpuid ]; then $(RMDIR) $(BUILD_DIR)/plugins/cpuid; fi
+ if [ -d $(BUILD_DIR)/plugins/systeminfo ]; then $(RMDIR) $(BUILD_DIR)/plugins/systeminfo; fi
+ if [ -d $(BUILD_DIR)/plugins ]; then $(RMDIR) $(BUILD_DIR)/plugins; fi
distclean: clean
- rm -rf netboot
+ rm -rf $(BUILD_DIR)/netboot
diff --git a/branding.nsi b/branding.nsi
index 4744ef7..77329a4 100644
--- a/branding.nsi
+++ b/branding.nsi
@@ -9,7 +9,7 @@
!define _OUTFILE_NAME "win32-loader.exe"
!endif
!ifndef _PROGRAM_ICON
- !define _PROGRAM_ICON "win32-loader.ico"
+ !define _PROGRAM_ICON "${BUILD_DIR}/win32-loader.ico"
!endif
!ifndef _COMPANY_NAME
!define _COMPANY_NAME "The Debian Project"
diff --git a/debian/rules b/debian/rules
index 94a8e0a..96db945 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,8 @@
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
+BUILD_DIR := build
+
# Install the win32-loader-standalone.exe as debian/tools/win32-loader/$(SUITE)/win32-loader.exe on the mirrors
BYHAND ?= yes
@@ -29,38 +31,42 @@ override_dh_auto_build:
ifeq ($(BYHAND),yes)
# Build the standalone+pxe version
# Don't allow non-Linux kernels, as their download is currently broken (see #819092)
- STANDALONE=yes \
+ dh_auto_build -- STANDALONE=yes \
PXE=yes \
NOT_ALLKERNELS=yes \
- OUTFILE_NAME=$(W32_BYHAND_NAME).exe \
+ OUTFILE_NAME="$(BUILD_DIR)/$(W32_BYHAND_NAME).exe" \
SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)" \
- dh_auto_build
+ BUILD_DIR="$(BUILD_DIR)"
# Prepare the README file
gawk '{sub(/@PACKAGES_LIST@/,"$(PACKAGES_LIST)")}1 \
{sub(/@NSIS_VERSION@/,"$(NSIS_VERSION)")}1 \
{sub(/@W32_VERSION@/,"$(DEB_VERSION)")}1' \
- debian/win32-loader_doc.txt > $(W32_BYHAND_NAME).txt
- cat debian/copyright >> $(W32_BYHAND_NAME).txt
+ debian/win32-loader_doc.txt \
+ > "$(BUILD_DIR)/$(W32_BYHAND_NAME).txt"
+ cat debian/copyright >> "$(BUILD_DIR)/$(W32_BYHAND_NAME).txt"
endif
# Build the cdrom version
- OUTFILE_NAME=win32-loader.exe \
+ dh_auto_build -- OUTFILE_NAME="$(BUILD_DIR)/win32-loader.exe" \
SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)" \
- dh_auto_build
+ BUILD_DIR="$(BUILD_DIR)"
+
+override_dh_install:
+ dh_install --sourcedir="$(BUILD_DIR)"
override_dh_auto_clean:
- dh_auto_clean
- rm -f $(W32_BYHAND_NAME).exe
- rm -f $(W32_BYHAND_NAME).txt
+ rm -f "$(BUILD_DIR)/$(W32_BYHAND_NAME).exe" \
+ "$(BUILD_DIR)/$(W32_BYHAND_NAME).txt"
+ dh_auto_clean -- BUILD_DIR="$(BUILD_DIR)"
override_dh_builddeb:
dh_builddeb
ifeq ($(BYHAND),yes)
- cp $(W32_BYHAND_NAME).exe ../
- dpkg-distaddfile $(W32_BYHAND_NAME).exe byhand -
+ cp "$(BUILD_DIR)/$(W32_BYHAND_NAME).exe" ../
+ dpkg-distaddfile "$(W32_BYHAND_NAME).exe" byhand -
- cp $(W32_BYHAND_NAME).txt ../
- dpkg-distaddfile $(W32_BYHAND_NAME).txt byhand -
+ cp "$(BUILD_DIR)/$(W32_BYHAND_NAME).txt" ../
+ dpkg-distaddfile "$(W32_BYHAND_NAME).txt" byhand -
endif
override_dh_gencontrol:
diff --git a/l10n/Makefile b/l10n/Makefile
index fd0b000..f7a343c 100644
--- a/l10n/Makefile
+++ b/l10n/Makefile
@@ -1,34 +1,44 @@
# Add only languages really supported by NSIS there
# For others, a PO file may be added and kept until NSIS is translated
# Languages not yet supported by NSIS: ast bn dz kk ml ta te ug vi
+
+MKDIR_P := mkdir -p
+TEMPLATES := templates
+PO := po
+
LINGUAS= ar be bg bs ca cs da de el en eo es eu fa fi fr ga gl he hr hu is it ja ko lt nb nl pl pt pt_BR ro ru sk sl sq sr sr@latin sv th tr uk zh_CN zh_TW
-all: templates/all.nsh templates/dialog.nsh po/messages.pot
+all: $(TEMPLATES)/all.nsh $(TEMPLATES)/dialog.nsh po/messages.pot
-templates/dialog.nsh: templates/all.nsh
+$(TEMPLATES):
+ $(MKDIR_P) $@
+
+$(TEMPLATES)/dialog.nsh: win32-loader.sh $(TEMPLATES)/all.nsh | $(TEMPLATES)
for i in $(LINGUAS) ; do \
- echo "Push \$${`LANGUAGE=$$i ./win32-loader.sh LANG_ENGLISH`}" ; \
- echo "Push \"`LANGUAGE=$$i ./win32-loader.sh English`\"" ; \
+ echo "Push \$${`LANGUAGE=$$i $< LANG_ENGLISH`}" ; \
+ echo "Push \"`LANGUAGE=$$i $< English`\"" ; \
done > $@
-templates/all.nsh: $(foreach lang, $(LINGUAS), templates/$(lang).nsh)
+$(TEMPLATES)/all.nsh: $(foreach lang, $(LINGUAS), $(TEMPLATES)/$(lang).nsh) | $(TEMPLATES)
for i in $^ ; do echo "; BEGIN $$i" ; cat $$i ; echo "; END $$i" ; done > $@
win32-loader: win32-loader.c
gcc -DTEXTDOMAINDIR=\"$(CURDIR)/locale\" $^ -o $@
-templates/en.nsh: win32-loader.sh win32-loader
- mkdir -p templates
- LANGUAGE=C ./win32-loader.sh > $@
+$(TEMPLATES)/en.nsh: win32-loader.sh win32-loader | $(TEMPLATES)
+ LANGUAGE=C $(realpath $<) > $@
+
+locale/%/LC_MESSAGES/win32-loader.mo: po/%.po $(PO)/messages.pot | $(TEMPLATES)
+ $(MKDIR_P) locale/$*/LC_MESSAGES
+ msgmerge -U $< $(dir $<)messages.pot
+ msgfmt -c --statistics -o $@ $<
-templates/%.nsh: po/%.po win32-loader.sh win32-loader po/messages.pot
- mkdir -p templates locale/$*/LC_MESSAGES
- msgmerge -U po/$*.po po/messages.pot
- msgfmt -c --statistics -o locale/$*/LC_MESSAGES/win32-loader.mo $<
- LANGUAGE=$* ./win32-loader.sh > $@
+$(TEMPLATES)/%.nsh: win32-loader.sh win32-loader locale/%/LC_MESSAGES/win32-loader.mo | $(TEMPLATES)
+ LANGUAGE=$* $(realpath $<) > $@
-po/messages.pot: win32-loader.sh win32-loader.c
+$(PO)/messages.pot: win32-loader.sh win32-loader.c
xgettext --msgid-bugs-address=win32-loader@packages.debian.org --from-code=utf-8 -ctranslate --keyword=_ $^ -o $@
clean:
- rm -rf *~ templates locale win32-loader
+ rm -rf $(TEMPLATES) locale win32-loader
+ rm -f $(foreach lang, $(LINGUAS), $(PO)/$(lang).po~)
diff --git a/main.nsi b/main.nsi
index 4b693ab..aa0e682 100644
--- a/main.nsi
+++ b/main.nsi
@@ -18,7 +18,11 @@
; SetCompressor must _always_ be the first command
SetCompressor /SOLID lzma
-!include l10n/templates/all.nsh
+!ifndef BUILD_DIR
+!define BUILD_DIR "."
+!endif
+
+!include ${BUILD_DIR}/l10n/templates/all.nsh
!include branding.nsi
@@ -46,9 +50,9 @@ ${BOOTCFG_SetPartition}
${BOOTCFG_SetPath}
${BOOTCFG_ReleaseObject}
-!addplugindir plugins
-!addplugindir plugins/cpuid
-!addplugindir plugins/systeminfo
+!addplugindir ${BUILD_DIR}/plugins
+!addplugindir ${BUILD_DIR}/plugins/cpuid
+!addplugindir ${BUILD_DIR}/plugins/systeminfo
;--------------------------------
diff --git a/onInit.nsi b/onInit.nsi
index 2fa2943..4b29616 100644
--- a/onInit.nsi
+++ b/onInit.nsi
@@ -101,7 +101,7 @@ Function .onInit
; Language selection dialog
Push ""
-!include l10n/templates/dialog.nsh
+!include ${BUILD_DIR}/l10n/templates/dialog.nsh
Push unsupported
Push "-- Not in this list --"
diff --git a/s_install.nsi b/s_install.nsi
index d0c97fb..369a89c 100644
--- a/s_install.nsi
+++ b/s_install.nsi
@@ -420,11 +420,11 @@ ${EndIf}
; ********************************************** Do bootloader last, because it's the most dangerous
${If} $windows_boot_method == ntldr
!ifdef NOCD
- File /oname=$c\g2ldr g2ldr
- File /oname=$c\g2ldr.mbr g2ldr.mbr
+ File /oname=$c\g2ldr "${BUILD_DIR}/g2ldr"
+ File /oname=$c\g2ldr.mbr "${BUILD_DIR}/g2ldr.mbr"
!ifdef PXE
${If} $pxe_mode == "true"
- File /oname=$INSTDIR\pxe.lkrn pxe.lkrn
+ File /oname=$INSTDIR\pxe.lkrn "${BUILD_DIR}/pxe.lkrn"
${EndIf} ; $pxe_mode == "true"
!endif ; PXE
!else
@@ -471,17 +471,17 @@ ${EndIf}
${Endif}
${If} $windows_boot_method == direct
- File /oname=$INSTDIR\loadlin.exe loadlin.exe
- File /oname=$INSTDIR\loadlin.pif loadlin.pif
+ File /oname=$INSTDIR\loadlin.exe "${BUILD_DIR}/loadlin.exe"
+ File /oname=$INSTDIR\loadlin.pif "${BUILD_DIR}/loadlin.pif"
${Endif}
${If} $windows_boot_method == bootmgr
!ifdef NOCD
- File /oname=$c\g2ldr g2ldr
- File /oname=$c\g2ldr.mbr g2ldr.mbr
+ File /oname=$c\g2ldr "${BUILD_DIR}/g2ldr"
+ File /oname=$c\g2ldr.mbr "${BUILD_DIR}/g2ldr.mbr"
!ifdef PXE
${If} $pxe_mode == "true"
- File /oname=$INSTDIR\pxe.lkrn pxe.lkrn
+ File /oname=$INSTDIR\pxe.lkrn "${BUILD_DIR}/pxe.lkrn"
${EndIf} ; $pxe_mode == "true"
!endif ; PXE
!else