-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (25 loc) · 1.08 KB
/
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
CC=/usr/bin/gcc
# TODO: have a configure script to alter PYCONFIG in order to alter what python is used
PYCONFIG=/usr/bin/python3.5-config
PKG_CONFIG=/usr/bin/pkg-config
CFLAGS=$(shell $(PKG_CONFIG) --cflags json-c) $(shell $(PYCONFIG) --cflags) -std=gnu11 -DSB_DEBUG
LDFLAGS=$(shell $(PKG_CONFIG) --libs json-c) $(shell $(PYCONFIG) --ldflags) -lseccomp
all: libsbpreload.so sandbox
sandbox: sandbox.o sandbox-child.o sandbox-parent.o sblibc.o sbio.o
$(CC) -o sandbox sandbox.o sandbox-child.o sandbox-parent.o sblibc.o sbio.o $(LDFLAGS)
sandbox.o: sandbox.c sbcontext.h
$(CC) -c sandbox.c $(CFLAGS)
sandbox-child.o: sandbox-child.c sbcontext.h
$(CC) -c sandbox-child.c $(CFLAGS)
sandbox-parent.o: sandbox-parent.c sbcontext.h
$(CC) -c sandbox-parent.c $(CFLAGS)
sblibc.o: sblibc.c sbcontext.h sblibc.h
$(CC) -c sblibc.c $(CFLAGS)
sbio.o: sbio.c sbcontext.h sblibc.h
$(CC) -c sbio.c $(CFLAGS)
libsbpreload.so: libsbpreload.o
$(CC) -o libsbpreload.so libsbpreload.o -shared $(LDFLAGS)
libsbpreload.o: libsbpreload.c
$(CC) -c libsbpreload.c $(CFLAGS)
clean:
rm sandbox libsbpreload.so *.o