-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
42 lines (31 loc) · 958 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
NAME := $(shell cat NAME)
PORT := $(shell cat PORT)
DOCKER_BUILD := docker run -v ./source/src:/src --rm -i -t $(NAME)-build bash -c
help:
@echo "prepare: prepare a docker image for compilation"
@echo "build : build the target"
@echo "dist : build the docker image"
@echo "release: build the target, docker image and release them"
@echo "run : run the docker container"
@echo "exploit: launch the exploit"
@echo "test : test the docker/exploit"
prepare:
(cd source; docker build -t $(NAME)-build .)
build:
$(DOCKER_BUILD) 'cd src; make'
cp -f source/src/target docker/
clean:
$(DOCKER_BUILD) 'cd src; make clean'
dist:
(cd docker; docker build -t $(NAME) .)
release:
make build
make dist
cp -f docker/target release/target
run:
docker run -p $(PORT):9999 --rm -i -t $(NAME)
exploit:
PORT=$(PORT) REMOTE=1 source/exploit.py
test:
PORT=$(PORT) REMOTE=1 source/test.py
.PHONY: dist build run exploit test help clean release