Skip to content

Commit

Permalink
Preserve buffetfsm binary on make clean
Browse files Browse the repository at this point in the history
The Dockerfile in this repo deletes the llvm build files after building
buffet, which means it cannot be rebuilt inside the running container.

- This commit allows zcc to continue without rebuilding buffet, if an
existing buffetfsm binary is available.

- This commit also prevents the buffetfsm binary from being blown away
on running `make clean` in the pepper directory.
  • Loading branch information
maxhowald committed Feb 18, 2019
1 parent 8813e51 commit 29c5da3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion compiler/zcc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,15 @@ if [ "$extension" == "c" ]; then
if [ $? != 0 ]; then
{
echo "Failed to build FSM transformer. Please make sure you have compiled LLVM."
exit 1

if [ ! -f buffetfsm ]; then
{
echo "FSM transformer not found. Terminating"
exit 1
}
else
echo "Found existing FSM transformer binary. Continuing without recompilation."
fi
} fi

cd ..
Expand Down
5 changes: 5 additions & 0 deletions install_buffet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ mkdir llvm-build
cd llvm-build
$PWD/../llvm/configure --prefix=$PWD/../toolchain --enable-shared --enable-optimized
make -j$(nproc)

# The commands below build the actual loop transformer binary.

cd ..
make
3 changes: 1 addition & 2 deletions pepper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ clean:
rm -f ../compiler/backend/tmptime
rm -f ../compiler/tmptime
cd ../compiler/frontend; make clean;
cd ../compiler/buffetfsm; make clean;

gadget%: ext_gadget_bridge.cpp
$(CXX) $(CXXFLAGS) -UBINARY_OUTPUT -DNAME=\"$(TARG)\" $(IFLAGS) $< -o $(BINDIR)/$@ $(COMMON_LIB_OBJFILES) $(LDFLAGS)
$(CXX) $(CXXFLAGS) -UBINARY_OUTPUT -DNAME=\"$(TARG)\" $(IFLAGS) $< -o $(BINDIR)/$@ $(COMMON_LIB_OBJFILES) $(LDFLAGS)

0 comments on commit 29c5da3

Please sign in to comment.