mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
Merge branch 'wip-tests' into wip-tests-build-refactor
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
commit
1efdbeda16
28 files changed
+703
-221
No files matched your search
@@ -0,0 +1,73 @@
|
||||
.PHONY: clean check
|
||||
|
||||
ARCH ?= x86_64
|
||||
|
||||
FINITBIN ?= ./sbin/finit
|
||||
|
||||
BBVER ?= 1.31.0
|
||||
BBBIN = busybox-$(ARCH)
|
||||
BBURL ?= https://www.busybox.net/downloads/binaries/$(BBVER)-defconfig-multiarch-musl/$(BBBIN)
|
||||
|
||||
binaries = ./bin/cat \
|
||||
./bin/cp \
|
||||
./bin/date \
|
||||
./bin/echo \
|
||||
./bin/env \
|
||||
./bin/find \
|
||||
./bin/kill \
|
||||
./bin/ls \
|
||||
./bin/mkdir \
|
||||
./bin/mkfifo \
|
||||
./bin/mknod \
|
||||
./bin/mount \
|
||||
./bin/printf \
|
||||
./bin/pgrep \
|
||||
./bin/ps \
|
||||
./bin/rm \
|
||||
./bin/sh \
|
||||
./bin/sleep \
|
||||
./bin/top \
|
||||
./bin/touch
|
||||
dirs = ./dev \
|
||||
./etc \
|
||||
./proc \
|
||||
./sbin \
|
||||
./sys \
|
||||
./test_assets \
|
||||
./tmp
|
||||
|
||||
_libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+')
|
||||
libs = $(foreach path,$(_libs_src),.$(path))
|
||||
|
||||
all: $(binaries) $(dirs) $(libs)
|
||||
|
||||
$(dirs):
|
||||
mkdir -p $@
|
||||
|
||||
./bin/$(BBBIN):
|
||||
wget -O $@ $(BBURL)
|
||||
chmod +x ./bin/$(BBBIN)
|
||||
md5sum -c $(BBBIN).md5
|
||||
|
||||
$(binaries): ./bin/$(BBBIN)
|
||||
cd ./bin; \
|
||||
rm -f $(notdir $@); \
|
||||
ln -s $(BBBIN) $(notdir $@)
|
||||
|
||||
$(libs):
|
||||
mkdir -p $(dir $@)
|
||||
cp /$@ $@
|
||||
|
||||
clean:
|
||||
rm -f ./bin/$(BBBIN)
|
||||
rm -rf $(binaries)
|
||||
rm -rf ./dev
|
||||
rm -rf ./etc
|
||||
rm -rf ./lib64
|
||||
rm -rf ./proc
|
||||
rm -rf ./sbin
|
||||
rm -rf ./sys
|
||||
rm -rf ./test_assets
|
||||
rm -rf ./tmp
|
||||
rm -rf ./usr
|
||||
rm -rf ./var
|
||||
Reference in new issue
Block a user