mirror of
https://github.com/eddyem/small-util.git
synced 2025-12-06 02:35:15 +03:00
15 lines
256 B
Bash
Executable File
15 lines
256 B
Bash
Executable File
#!/bin/sh
|
|
function compile_file(){
|
|
Name="$(echo "$1" | sed "s/\(.*\)\.c/\1/")"
|
|
gcc -Wall -Werror -lX11 -lm -lpthread "${Name}.c" -o "$Name"
|
|
}
|
|
|
|
if [ "$1" != "" ]; then
|
|
compile_file "$1"
|
|
else
|
|
for file in *.c; do
|
|
compile_file "$file"
|
|
done
|
|
fi
|
|
rm -f *.o
|