summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-10-13 01:48:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-11-12 17:37:42 +0200
commit97c71acb56c0d422f8d44cebba3b6ecd9c94ab5f (patch)
treef3b45fbfb28955f2a53f7125a39e1c740b60309b /Makefile
parent30aab83c0433a9c2b51fdeaaf01aba8c8bef259c (diff)
Add support for static compilationHEADmaster
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 07d1973..1783f55 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,18 @@
CROSS_COMPILE ?=
KDIR ?=
+STATIC ?=
CC := $(CROSS_COMPILE)gcc
CFLAGS := -O2 -W -Wall -I$(KDIR)/usr/include
LDFLAGS := -Lisp
-LIBS := -lomap3isp -lrt
+LIBS := -lomap3isp -lpthread -lrt
+
+ifneq (x$(STATIC), x)
+LIBS += -static
+LIB_ISP := isp/libomap3isp.a
+else
+LIB_ISP := isp/libomap3isp.so
+endif
OBJ_LIVE := live.o events.o iq.o videoout.o
OBJ_SNAP := snapshot.o events.o iq.o
@@ -21,10 +29,10 @@ endif
all: __isp live snapshot
-live: $(OBJ_LIVE) isp/libomap3isp.so
+live: $(OBJ_LIVE) $(LIB_ISP)
$(CC) $(LDFLAGS) -o $@ $(OBJ_LIVE) $(LIBS)
-snapshot: $(OBJ_SNAP) isp/libomap3isp.so
+snapshot: $(OBJ_SNAP) $(LIB_ISP)
$(CC) $(LDFLAGS) $(SNAP_LDFLAGS) -o $@ $(OBJ_SNAP) $(LIBS) $(SNAP_LIBS)
__isp: