Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplified make-package script
  • Loading branch information
fresheed committed Jun 13, 2025
commit 90d6b177830ccf243f6c1fafdef5a2d001a2710d
28 changes: 3 additions & 25 deletions make-package
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
#!/bin/bash
# A simplified version of Iris project build script.
set -e
# adapted from Iris repo build script.
# Helper script to build and/or install just one package out of this repository.
# Assumes that all the other packages it depends on have been installed already!

# Make sure we get a GNU version of make.
# This is exactly how opam determines which make executable to use.
OS=$(uname)
MAKE="make"
if [ $OS == "FreeBSD" ] || [ $OS == "OpenBSD" ] ||\
[ $OS == "NetBSD" ] || [ $OS == "DragonFly" ]; then
MAKE="gmake"
fi

PROJECT="$1"
shift

COQFILE="_CoqProject.$PROJECT"
MAKEFILE="Makefile.package.$PROJECT"

# if ! grep -E -q "^$PROJECT/" _CoqProject; then
# echo "No files in $PROJECT/ found in _CoqProject; this does not seem to be a valid project name."
# exit 1
# fi

# Generate _CoqProject file and Makefile
rm -f "$COQFILE"
# Get the right "-Q" line.
grep -E "^-Q $PROJECT[ /]" _CoqProject >> "$COQFILE"
# # Get everything until the first empty line except for the "-Q" lines.
# sed -n '/./!q;p' _CoqProject | grep -E -v "^-Q " >> "$COQFILE"
cp _CoqProject "$COQFILE"
# # Get the files.
# grep -E "^$PROJECT/" _CoqProject >> "$COQFILE"
echo >> "$COQFILE"
# Get the files.
find "$PROJECT/" -type f -name "*.v" >> "$COQFILE"
# Now we can run coq_makefile.
"${COQBIN}coq_makefile" -f "$COQFILE" -o "$MAKEFILE"

# Run build
$MAKE -f "$MAKEFILE" "$@"
make -f "$MAKEFILE" "$@"

# Cleanup
rm -f ".$MAKEFILE.d" "$MAKEFILE"*