Skip to content

Commit

Permalink
Simplify cloning/building.
Browse files Browse the repository at this point in the history
Kafel submodule will be automatically initialized if not done manually
before invoking `make`.
  • Loading branch information
happyCoder92 committed May 15, 2017
1 parent f2c8fff commit dc42815
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM ubuntu

RUN apt-get update && apt-get install gcc make git bison flex -y
RUN git clone https://github.com/google/nsjail.git
RUN cd /nsjail && git submodule update --init && cd kafel && make && cd .. && make
RUN cd /nsjail && make
RUN mv /nsjail/nsjail /bin && rm -rf -- /nsjail

9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,21 @@ ifeq ($(USE_NL3), yes)
endif
endif

.PHONY: all clear depend indent kafel

.c.o: %.c
$(CC) $(CFLAGS) $< -o $@

all: $(BIN)
all: kafel $(BIN)

$(BIN): $(OBJS) $(LIBS)
$(CC) -o $(BIN) $(OBJS) $(LIBS) $(LDFLAGS)

kafel:
ifeq ("$(wildcard kafel/Makefile)","")
git submodule update --init
endif

kafel/libkafel.a:
$(MAKE) -C kafel

Expand Down

0 comments on commit dc42815

Please sign in to comment.