aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <somasis@exherbo.org>2016-02-09 23:04:44 -0500
committerKylie McClain <somasis@exherbo.org>2016-02-09 23:04:54 -0500
commitd9b00098b65ecc70d8618bc621b0108a795c2d7d (patch)
tree4123c7c426c90487fe74e8253d0fd60f6efc3323
parent039ab6d8e7939d133d9dc6a1d196b9de5e18012c (diff)
downloadlighter-d9b00098b65ecc70d8618bc621b0108a795c2d7d.tar.gz
lighter-d9b00098b65ecc70d8618bc621b0108a795c2d7d.tar.xz
lighter-d9b00098b65ecc70d8618bc621b0108a795c2d7d.zip
more
-rw-r--r--Makefile28
-rw-r--r--scripts/build/dropbear7
-rwxr-xr-xscripts/build/mksh2
-rwxr-xr-xscripts/build/toybox6
-rw-r--r--skel/dev/.keep0
5 files changed, 26 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 6bb8ea9..bf1823e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ VERSION =scm
CFLAGS ?= -Os
CXXFLAGS ?= $(CFLAGS)
-CFLAGS += -I$(BUILD)/include -L$(BUILD)/lib -static
+CFLAGS += -static
LDFLAGS += -static
export CFLAGS
@@ -17,21 +17,21 @@ BUILD ?= $(PWD)/build
PATH += :$(PWD)/toolchain
urls = \
- http://www.musl-libc.org/releases/musl-1.0.5.tar.gz \
http://landley.net/toybox/downloads/toybox-0.7.0.tar.gz \
- http://sources.voidlinux.eu/sources/mksh-R52b/mksh-R52b.tgz
+ http://sources.voidlinux.eu/sources/mksh-R52b/mksh-R52b.tgz \
+ https://matt.ucc.asn.au/dropbear/releases/dropbear-2015.71.tar.bz2
-make = musl toybox mksh
+make = toybox mksh dropbear
all:
@printf "lighter $(VERSION)\n\n"
@printf "%-20s%-20s\n" \
"CFLAGS" "$(CFLAGS)" \
"CXXFLAGS" "$(CXXFLAGS)" \
- "MAKEFLAGS" "$(MAKEFLAGS)" \
+ "JOBS" "$(JOBS)" \
"BUILD" "$(BUILD)"
@printf "\n"
- @$(MAKE) --no-print-directory build
+ @$(MAKE) build
toolchain:
@printf "making any needed toolchain links...\n"
@@ -39,14 +39,13 @@ toolchain:
@printf "\n"
# @for d in $(dirs);do echo "mkdir -p $(BUILD)/$$d"; [ -d "$$d" ] || mkdir -p $(BUILD)/"$$d";done
-skel:
+prepare: toolchain skel
@printf "copying skeleton root to %s...\n" "$(BUILD)"
-mkdir -p "$(BUILD)"
- @cp -r skel/* $(BUILD)
+ -mkdir "$(BUILD)"/root
+ @cp -r skel/* "$(BUILD)"/root/
@printf "\n"
-prepare: toolchain skel
-
fetch: prepare
@printf "fetching all needed files...\n"
@sh -e scripts/fetch $(urls)
@@ -59,17 +58,20 @@ extract: fetch
build/.built-%: toolchain
@printf "building %s...\n" "$*"
- @BUILD="$(BUILD)" J="$(JOBS)" sh -e scripts/build/$* && touch build/.built-$*
+ mkdir -p "$(BUILD)/$*"
+ DESTDIR="$(BUILD)/$*" BUILD="$(BUILD)/root" J="$(JOBS)" sh -e scripts/build/$*
+ cp -R "$(BUILD)/$*"/* "$(BUILD)/root"
+ @touch build/.built-$*
@printf "\n"
clean-%:
@printf "cleaning archives/%s...\n" "$*"
- @rm -rf archives/"$*"*
+ rm -rf archives/"$*"*
build: prepare fetch extract $(foreach m,$(make),build/.built-$(m))
clean:
rm -rf downloads archives $(BUILD) toolchain
-.PHONY: all skel toolchain fetch extract build
+.PHONY: clean all prepare fetch extract build
diff --git a/scripts/build/dropbear b/scripts/build/dropbear
new file mode 100644
index 0000000..8eb8739
--- /dev/null
+++ b/scripts/build/dropbear
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd archives/dropbear-*
+
+./configure --prefix=/ --sbindir=/bin --disable-{syslog,shadow,lastlog,utmp,utmpx,wtmp,wtmpx}
+make -j$J MULTI=1
+make -j$J MULTI=1 install
diff --git a/scripts/build/mksh b/scripts/build/mksh
index 77c3206..3cd3757 100755
--- a/scripts/build/mksh
+++ b/scripts/build/mksh
@@ -3,4 +3,4 @@
cd archives/mksh
sh ./Build.sh -r -c lto
-install -s -D mksh "$BUILD"/bin/sh
+install -s -D mksh "$DESTDIR"/bin/sh
diff --git a/scripts/build/toybox b/scripts/build/toybox
index 204f043..46dacff 100755
--- a/scripts/build/toybox
+++ b/scripts/build/toybox
@@ -4,8 +4,8 @@ cd archives/toybox-*
make -j$J defconfig
make -j$J toybox
-install -D toybox "$BUILD"/bin/toybox
-for bin in $("$BUILD"/bin/toybox);do
- ln -s toybox "$BUILD"/bin/"$bin"
+install -D toybox "$DESTDIR"/bin/toybox
+for bin in $("$DESTDIR"/bin/toybox);do
+ [ -e "$DESTDIR"/bin/"$bin" ] || ln -s toybox "$DESTDIR"/bin/"$bin"
done
diff --git a/skel/dev/.keep b/skel/dev/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/skel/dev/.keep