forked from janneku/bencode-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.in
59 lines (45 loc) · 1.38 KB
/
Makefile.in
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CC = {CC}
CFLAGS = -Wall -O2 -g {SHAREDLIBRARYFLAGS} -Iinclude {CFLAGS}
EXECFLAGS = -Wall -O2 -g -Iinclude {CFLAGS}
LDFLAGS = {LDFLAGS}
PREFIX = {PREFIX}
LIBPATH = {LIBPATH}
LIBNAME = {LIBNAME}
SHAREDNAMEFLAG = {SHAREDNAMEFLAG}
PYTHON = {PYTHON}
PYTHON_INSTALL_OPTION = {PYTHON_INSTALL_OPTION}
COMPILE_TARGETS = {COMPILE_TARGETS}
INSTALL_TARGETS = {INSTALL_TARGETS}
LIBMODULES = bencode.o
all: $(COMPILE_TARGETS)
compile-c: $(LIBNAME) bencodetest bencat
compile-python:
$(LIBNAME): $(LIBMODULES)
$(CC) -shared $(SHAREDNAMEFLAG) -o "$@" $(LIBMODULES)
bencode.o: bencode.c include/bencodetools/bencode.h
bencodetest: bencodetest.c $(LIBNAME)
$(CC) $(EXECFLAGS) -o "$@" $< -L. -Wl,-rpath,. -lbencodetools
bencat: bencat.c $(LIBNAME)
$(CC) $(EXECFLAGS) -o "$@" -L. $(LDFLAGS) $< -lbencodetools
check: bencodetest
./bencodetest
python bencode.py
python typevalidator.py
@echo
@echo "All tests successful" #
install-c:
@echo "Installing C library"
@echo
mkdir -p -m 755 "$(PREFIX)/lib" "$(PREFIX)/include/bencodetools" "$(PREFIX)/bin"
install -m 644 include/bencodetools/*.h "$(PREFIX)/include/bencodetools/"
install -m 644 $(LIBNAME) "$(LIBPATH)"
install bencat "$(PREFIX)/bin/"
install-python:
@echo
@echo "Installing Python packages"
$(PYTHON) setup.py install $(PYTHON_INSTALL_OPTION)
install: $(INSTALL_TARGETS)
%.o: %.c
$(CC) $(CFLAGS) -c $<
clean:
rm -f *.o *.so bencodetest bencat