blob: 1679151b5c3c0c7e419d2c30db30cb2af21bba97 [file] [log] [blame]
# Copyright 2011 Google Inc. All Rights Reserved.
# Author: qianzhang@google.com (ken Zhang)
#MAKEFILE for cross platform
DEBUG=-g
ifdef DEBUG
DEBUG_CFLAGS= -g $(DEBUG)
else
DEBUG_CFLAGS= -O3
endif
ifdef TARGET
CROSS_PREFIX:=$(TARGET)
else
CROSS_PREFIX:=
endif
CC:=$(CROSS_PREFIX)gcc
LD:=$(CROSS_PREFIX)ld
AR:=$(CROSS_PREFIX)ar
RANLIB:=$(CROSS_PREFIX)ranlib
STRIP:=$(CROSS_PREFIX)strip
CFLAGS= -Wall -fPIC -O2 -Wpointer-arith
FILES=sagelog.c hdhomerun_tuner.c hdhomerun_http.c hdhomerun_dev.c utility.c hdhomerun_plugin.c
INC= sagelog.h hdhomerun_tuner.h hdhomerun_http.h hdhomerun_dev.h utility.h
EXTRA_INCS= ../tvstreamparser
#all:hdhomerun
all:hdhr_plugin.so
dep_make:hdrun_dep
hdhr_plugin.so:dep_make $(FILES) $(INC)
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(FILES) -shared -o hdhr_plugin.so -I$(EXTRA_INCS) -L. -lhdhomerun -lpthread
hdhomerun:dep_make $(FILES) $(INC)
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(FILES) -DTEST_APP -o hdhomerun -I$(EXTRA_INCS) -L. -lhdhomerun -lpthread
hdrun_dep:
make -C libhdhomerun
cp libhdhomerun/libhdhomerun.so .
clean:
rm -f $(ALL) hdrun libhdhomerun.so hdhr_plugin.so get_http *~
make clean -C libhdhomerun
get_http:hdhomerun_http.c hdhomerun_http.h
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -DHTTP_GET_APP hdhomerun_http.c -o get_http