-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit.sh
executable file
·67 lines (49 loc) · 1.14 KB
/
submit.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/sh
# Author: Jakub Antonín Štigler
set -e
make doc
LOGIN=xstigl00
mkdir $LOGIN
cp -r src n2tcap CMakeLists.txt README $LOGIN/
cp doc/manual.pdf $LOGIN/manual.pdf
printf '# Author: Jakub Antonín Štigler (xstigl00)
# Makefile generated for submit
BUILD_TYPE=Release
CXX=g++-14.2
CMAKE_FLAGS=-DCMAKE_CXX_COMPILER=$(CXX) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
PARALEL=$(shell nproc)
.PHONY: all
all: build
.PHONY: build
build:
\tif [ ! -f build/Makefile ]; then \\
\t\tmkdir build; \\
\t\tcd build \\
\t\t\t&& cmake .. $(CMAKE_FLAGS); \\
\tfi
\tcd build && $(MAKE) -j $(PARALEL)
\tmv build/p2nprobe p2nprobe
clean:
\t-cd build && $(MAKE) clean
\t-rm p2nprobe
' > $LOGIN/Makefile
printf '
# Additional configuration added on submit
target_link_libraries(p2nprobe PRIVATE -static-libstdc++)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(n2tcap PRIVATE -static-libstdc++)
endif()
' >> $LOGIN/CMakeLists.txt
printf '
Files:
' >> $LOGIN/README
cd $LOGIN
for f in `find . -name '*'`; do
if [ -f "$f" ]; then
echo " ${f#./}" >> README
fi
done
tar cf $LOGIN.tar -- *
cd ..
mv $LOGIN/$LOGIN.tar $LOGIN.tar
rm -r $LOGIN