2023-03-05 00:44:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-08-21 23:04:39 +00:00
|
|
|
source ./scripts/common.sh
|
|
|
|
|
2023-08-21 22:23:41 +00:00
|
|
|
FILES=(
|
|
|
|
arri_s
|
|
|
|
bellows
|
|
|
|
cpc_connectors
|
|
|
|
mcopy_rails
|
|
|
|
mcopy_projector
|
2023-09-06 03:15:32 +00:00
|
|
|
mcopy_lens_assembly
|
2023-08-21 22:23:41 +00:00
|
|
|
)
|
|
|
|
|
2023-08-21 23:04:39 +00:00
|
|
|
PARALLEL=0
|
|
|
|
HAS_PARALLEL=$(which parallel)
|
|
|
|
if [[ "${HAS_PARALLEL}" != "" ]]; then
|
|
|
|
PARALLEL=1
|
|
|
|
fi
|
2023-03-05 22:13:42 +00:00
|
|
|
|
2023-08-21 22:23:41 +00:00
|
|
|
if [[ "${1}" == "all" ]]; then
|
|
|
|
for file in "${FILES[@]}"; do
|
|
|
|
allParts "${file}"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
if [ -f "scad/${1}.scad" ]; then
|
2023-08-21 23:04:39 +00:00
|
|
|
if [ ${PARALLEL} -eq 1 ]; then
|
|
|
|
parallelParts "${1}"
|
|
|
|
else
|
|
|
|
allParts "${1}"
|
|
|
|
fi
|
2023-08-21 22:23:41 +00:00
|
|
|
elif [[ "${1}" != "" ]]; then
|
|
|
|
echo "File scad/${1}.scad not found"
|
|
|
|
exit 2
|
|
|
|
else
|
|
|
|
echo "Please provide a target to compile or use \"all\""
|
|
|
|
fi
|
2023-04-17 03:33:11 +00:00
|
|
|
fi
|