thiagoauler-apple1/build.sh

21 lines
356 B
Bash
Raw Normal View History

2017-11-12 02:31:55 +00:00
SRC_FOLDER="src"
OBJ_FOLDER="obj"
EXEC_NAME="apple1"
# clear any previous object
rm -rf $OBJ_FOLDER
rm -f $EXEC_NAME
# build all source code
for FILE in $SRC_FOLDER/*.c
do
2017-11-14 21:42:36 +00:00
cc -g -c $FILE
2017-11-12 02:31:55 +00:00
done
# move all objects to appropriate folder
mkdir -p $OBJ_FOLDER
mv *.o $OBJ_FOLDER
# create executable out of the objects
2017-11-14 21:42:36 +00:00
cc -g -o $EXEC_NAME $OBJ_FOLDER/*.o