1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

create proxies for the whole argument list of the bash script

=> our Makefile creates with one command all example procies
This commit is contained in:
Stefan Lankes 2015-10-05 10:47:55 +02:00
parent 18727027cc
commit 895edc205a
2 changed files with 10 additions and 8 deletions

View file

@ -5,7 +5,7 @@ CC = gcc
CFLAGS = -O2 -Wall
HEXDUMP = hexdump
LDFLGAS =
EXECFILES = ../usr/examples/hello #$(shell find ../usr/examples -perm -u+r+x -type f)
INITRDFILES = ../usr/examples/hello #$(shell find ../usr/examples -perm -u+r+x -type f)
PROXYFILES = $(shell find ../usr/examples -perm -u+r+x -type f)
# Prettify output
@ -38,16 +38,16 @@ initrd.o: initrd.S initrd.img
@echo [CC] Build initrd as object file
$Q$(CC) -c -o $@ initrd.S
initrd.img: $(EXECFILES) make_initrd
initrd.img: $(INITRDFILES) make_initrd
@echo [MAKE_INITRD] initrd.img
$Q./make_initrd /bin $(foreach FILE, $(EXECFILES), $(FILE) $(shell basename $(FILE)))
$Q./make_initrd /bin $(foreach FILE, $(INITRDFILES), $(FILE) $(shell basename $(FILE)))
make_initrd: make_initrd.o
$Q$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
proxy: $(PROXYFILES)
@echo [PROXY] Create proxy files
$Q./create_proxy.sh $(foreach FILE, $(EXECFILES), $(FILE))
$Q./create_proxy.sh $(foreach FILE, $(PROXYFILES), $(FILE))
clean:
@echo Cleaning tools

View file

@ -1,8 +1,7 @@
#!/bin/bash
if test "$#" -ne 1; then
echo "Illegal number of parameters"
else
while [[ $# > 0 ]]
do
fname=$(basename "$1")
fname_new=$(basename "$1")_proxy
@ -20,4 +19,7 @@ else
echo ".int app_size - hermit_app" >> inc.S
cc -O2 -Wall -o $fname_new proxy.c inc.S
fi
rm -rf inc.S
shift
done