-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
46 lines (30 loc) · 848 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
43
44
45
CC = gcc
INSTALL = install
PREFIX = /usr/local
CFLAGS += -Wall -fPIC -Isrc
LDFLAGS += -shared -ldl
OBJ = build/faketime.o
SONAME = 1
LIBS = build/libhdistjail.so.${SONAME}
all: build ${LIBS}
build/hdistjail.c: src/hdistjail.c.in
./runjinja.py $< $@
build/hdistjail.o: build/hdistjail.c
${CC} -o $@ -c ${CFLAGS} $<
build/libhdistjail.so.${SONAME}: build/hdistjail.o
${CC} -o $@ -Wl,-soname,libhdistjail.so.${SONAME} $< ${LDFLAGS}
clean:
@rm -rf build
distclean: clean
@echo
install: ${LIBS}
@echo
$(INSTALL) -dm0755 "${DESTDIR}${PREFIX}/lib/"
$(INSTALL) -m0644 ${LIBS} "${DESTDIR}${PREFIX}/lib/"
test: build/hdistjail.so
python test_jail.py --nocapture -v
simpletest: build/hdistjail.so
LD_PRELOAD=build/hdistjail.so HDIST_JAIL_LOG=jail.log cat hello
build:
mkdir build
.PHONY: all clean distclean install test simpletest