-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (60 loc) · 1.82 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Makefile for unity build of hybris library.
#
include config.mk
CFLAGS+=-Wall -Wno-gnu-designator -DPSO_EVEN_MORE_COMBINATIONS
ifeq ($(OS),Windows_NT)
TARGET:=Windows
CFLAGS+= -mconsole
else
TARGET := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
endif
ifeq ($(CC),clang)
CFLAGS+= -ferror-limit=1
else
CFLAGS+= -fmax-errors=1
endif
ifeq ($(RELMODE), Release)
CFLAGS+= -O3 -march=native -DNDEBUG
else ifeq ($(RELMODE), RelWDbgInfo)
CFLAGS+= -O3 -march=native -DNDEBUG -DLOGLEVEL_INFO
else ifeq ($(RELMODE), RelPortable)
CFLAGS+= -O2 -DNDEBUG
endif
ifeq ($(CEC_BECNHMARK), True)
CFLAGS+=-DADD_CECBENCHMARK
endif
.PHONY: prepare
all: prepare static shared
prepare:
@echo "Building for $(TARGET)"
mkdir -p ./bin/${TARGET}/obj
shared: prepare
$(CC) -shared chybris/lib.c -fPIC -o ./bin/${TARGET}/lib${LIBNAME}.so ${CFLAGS}
static: prepare
$(CC) -c chybris/lib.c -fPIC -o ./bin/${TARGET}/obj/temp.o ${CFLAGS}
ar rcs ./bin/${TARGET}/lib${LIBNAME}.a ./bin/${TARGET}/obj/temp.o
standalone: static
$(CC) standalones/prog_${PROGRAM}.c ./bin/${TARGET}/lib${LIBNAME}.a -o ./bin/${TARGET}/${PROGRAM}.exe -I ./chybris/ -lm $(CFLAGS)
install:
mkdir -p ${PREFIX}/include
mkdir -p ${PREFIX}/lib
cp chybris/*.h ${PREFIX}/include/
cp bin/${TARGET}/libhybris.a ${PREFIX}/lib/
tarball:
mkdir -p hybris_tarball
cp -r hybris hybris_tarball
cp -r chybris hybris_tarball
cp Makefile hybris_tarball
cp config.mk hybris_tarball
cp requirements.txt hybris_tarball
cp -r tests hybris_tarball
cp -r standalones hybris_tarball
cp setup.py hybris_tarball
cp README.md hybris_tarball
tar -czvf hybris.tar.gz hybris_tarball
pip_package:
python setup.py bdist_wheel --universal
clean:
rm -rf hybris_py.egg-info
rm -rf dist bin build