Skip to content

Commit

Permalink
add h series and modify makefile for supporting more models
Browse files Browse the repository at this point in the history
  • Loading branch information
harlequin committed Jun 28, 2016
1 parent adf3191 commit 1bdfc28
Show file tree
Hide file tree
Showing 3 changed files with 365 additions and 19 deletions.
50 changes: 35 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
TARGETS=libdvbapi.so

CFLAGS += -fPIC -O2 -std=gnu99 -I../include -mglibc -march=34kc
APP_OBJ = dvbapi.o hook.o C_support.o log.o
LIB_TV_MODEL=
CFLAGS += -fPIC -O2 -std=gnu99
CFLAGS += -ldl -DBUILD_GIT_SHA=\"$(GIT_VERSION)\"
GIT_VERSION := $(shell git describe --dirty --always --abbrev=4)
BRANCH := $(shell git symbolic-ref --short -q HEAD)

# DEFAULT VERSION INFORMATION
CFLAGS += -DLIB_NAME=\""dvbapi"\" -DLIB_VERSION=\""v0.1"\" -DLIB_TV_MODELS=\""D T-MST"\"
ifeq ($(PLATFORM), D-MST)
LIB_TV_MODEL=${PLATFORM}
APP_OBJ += models/serie_d_mst.o
CFLAGS += -mel -mglibc -march=34kc
endif

ifeq ($(PLATFORM), H-MST)
LIB_TV_MODEL=${PLATFORM}
APP_OBJ += models/serie_h_mst.o
CFLAGS +=
endif

all: ${TARGETS}

libdvbapi.so: dvbapi.c hook.c C_support.c log.c models/serie_d_mst.c $(wildcard *.h) $(wildcard ../include/*.h)
$(CROSS)gcc $(filter %.c %.cpp,$^) ${CFLAGS} -mel -shared -Wl,-soname,$@ -o $@

clean:
rm -f ${TARGETS}

ifeq (${TARGET_IP}, )
OBJS = $(APP_OBJ)
LIB:=libdvbapi-${PLATFORM}-${BRANCH}-${GIT_VERSION}.so

# DEFAULT VERSION INFORMATION
CFLAGS += -DLIB_NAME=\""dvbapi"\" -DLIB_VERSION=\""${BRANCH}"\" -DLIB_TV_MODELS=\""${LIB_TV_MODEL}"\"

all: libdvbapi.so
ifeq ($(LIB_TV_MODEL), )
$(error No platform selected!)
endif

install: ${TARGETS}
ping -c1 -W1 -w1 ${TARGET_IP} >/dev/null && \
lftp -v -c "open ${TARGET_IP};cd ${TARGET_DEST_DIR};mput $^;"
libdvbapi.so: $(OBJS)
$(CROSS)gcc $(CFLAGS) $(OBJS) -shared -Wl,-soname,$(LIB) -o $(LIB)


#$(CROSS)gcc $(CFLAGS) $(OBJS) -shared -Wl,-soname,$@ -o $@

.c.o:
$(CROSS)gcc $(CFLAGS) -c -o $@ $<

clean:
rm -f $(OBJS) ${TARGETS} ./models/*.o

.PHONY: clean
.PHONY: install
6 changes: 3 additions & 3 deletions models/serie_d_mst.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static demux_filter_t *g_demux_filter = NULL;
static SdTSData_Settings_t g_emmParams;

typedef union {
const void *procs[19];
const void *procs[18];
struct {
const int (*SdTSData_StartMonitor)(u32 dmx_handle, SdTSData_Settings_t *a1);
const int (*SdTSData_StopMonitor)(u32 dmx_handle, u32 mon_handle);
Expand All @@ -75,7 +75,6 @@ typedef union {
const int (*MDrv_DSCMB_FltTypeSet)(unsigned int u32DscmbId, unsigned int eType);
const int (*MDrv_DSCMB_FltAlloc)(void);
const int (*MDrv_DSCMB_FltKeySet)(u32 u32DscmbId, DSCMB_Key_Type eKeyType, u8 *pu8Key);
const int (*SdAVDec_DemuxStart) (unsigned int dmxHandle, int eDemuxOut);
};

} api_callbacks_t;
Expand All @@ -99,7 +98,6 @@ api_callbacks_t api_callbacks = {
(const void*)"MDrv_DSCMB_FltTypeSet",
(const void*)"MDrv_DSCMB_FltAlloc",
(const void*)"MDrv_DSCMB_FltKeySet",
(const void*)"_Z18SdAVDec_DemuxStartj18SdAVDec_DemuxOut_k",
};

static void stopMonitors() {
Expand Down Expand Up @@ -271,6 +269,8 @@ STATIC hook_entry_t TCCIMManagerBase_hooks[] =
};


//////////////////////////////////////////////////////////////////////////////

int dvbapi_install(void *h) {
int res = 0;

Expand Down
Loading

0 comments on commit 1bdfc28

Please sign in to comment.