-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 963 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#executables := $(ls ./script/*.sh)
SOURCES := $(basename $(notdir $(shell find ./script -name '*.sh')))
TODAY=$(shell date +'%Y-%m-%d')
.PHONY: all
all:$(SOURCES)
.PHONY:container
container:buildcontainer.sif
.PHONY: clean
clean:
rm -rf ./temp/
rm -rf ./bin/
rm ./buildcontainer.sif
.phony:tar
tar:all
tar -cf "staticBins_dabosch_${TODAY}.tar" bin/ Readme.md
buildcontainer.sif: | buildcontainer.txt
apptainer build --fakeroot buildcontainer.sif buildcontainer.txt
bin/% : script/%.sh
mkdir -p ./bin
mkdir -p temp
apptainer exec -c --no-home -B "./temp/:${HOME}" -B "./script:${HOME}/script:ro" -B "./bin:${HOME}/bin" -B "./code:${HOME}/code:ro" ./buildcontainer.sif "$<"
chmod -R 700 ./temp/
rm -rf ./temp/
$(SOURCES): %: bin/%
interactive:
mkdir -p ./bin
mkdir -p temp
apptainer shell -c --no-home -B "./temp/:${HOME}" -B "./script:${HOME}/script:ro" -B "./bin:${HOME}/bin" -B "./code:${HOME}/code:ro" ./buildcontainer.sif
rm -rf ./temp/