added tools, Makefile, and setup

This commit is contained in:
Derek Tan
2024-06-26 03:36:43 -04:00
parent cb0557932a
commit 3e1fb62242
8 changed files with 119 additions and 0 deletions

25
tools/compile Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# Use this script to compile your .cc files in dependency order
# Arguments:
# $1 = name of file containing list of .cc files
# $2 = name of the output file
cxx="g++-11"
cxxflags="-std=c++20 -fmodules-ts -Wall -g"
if [ $# -lt 1 ]; then
echo "Usage: $0 list-filename [output-name]" 1>&2
exit 1
fi
if [ $# -eq 2 ]; then
name="-o $2"
fi
for x in $(cat $1); do
$cxx $cxxflags -c $x
done
$cxx *.o $name