-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile-shared
34 lines (26 loc) · 1.08 KB
/
Makefile-shared
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
# Path to the target shared library
TARGET_LIB = lib/libomxcam.so
CC = gcc
# Add -DOMXCAM_DEBUG for debugging purposes
CFLAGS = -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \
-DTARGET_POSIX -D_LINUX -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \
-D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -DHAVE_LIBOPENMAX=2 -DOMX \
-DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST \
-DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -fPIC -ftree-vectorize -pipe \
-Werror -g -Wall -O2 -fvisibility=hidden -DOMXCAM_DEBUG
LDFLAGS = -shared
INCLUDES = -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads \
-I/opt/vc/include/interface/vmcs_host/linux -I./src -I./include
SRC = $(wildcard src/*.c)
OBJS = $(patsubst src/%.c,src/%.o,$(SRC))
all: $(TARGET_LIB)
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations
$(TARGET_LIB): $(OBJS)
@mkdir -p $(@D)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
.PHONY: clean rebuild
clean:
rm -f $(TARGET_LIB) src/*.o
rebuild:
make -f Makefile-shared clean && make -f Makefile-shared