| # Copyright 2011 Google Inc. All Rights Reserved. |
| # Author: qianzhang@google.com (ken Zhang) |
| |
| DEBUG=-g |
| ifdef DEBUG |
| DEBUG_CFLAGS:=$(DEBUG) |
| else |
| DEBUG_CFLAGS:=-O3 |
| endif |
| |
| CC:=$(CROSS_COMPILE)gcc |
| LD:=$(CROSS_COMPILE)ld |
| |
| CFLAGS=-Wall -O2 -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror |
| LDFLAGS=-L./libhdhomerun -lhdhomerun -lpthread |
| SHARED=-fPIC -shared |
| |
| SRCS=sagelog.c hdhomerun_tuner.c hdhomerun_http.c hdhomerun_dev.c utility.c hdhomerun_plugin.c |
| INCS=sagelog.h hdhomerun_tuner.h hdhomerun_http.h hdhomerun_dev.h utility.h |
| LIBS=libhdhomerun/libhdhomerun.so |
| |
| .PHONY: all |
| all: hdhr_plugin.so |
| |
| hdhr_plugin.so: $(LIBS) $(SRCS) $(INCS) |
| $(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(SHARED) $(SRCS) $(LDFLAGS) -o $@ |
| |
| hdhomerun: $(LIBS) $(SRCS) $(INCS) |
| $(CC) $(CFLAGS) $(DEBUG_CFLAGS) -DTEST_APP $(SRCS) $(LDFLAGS) -o $@ |
| |
| get_http: hdhomerun_http.c hdhomerun_http.h |
| $(CC) $(CFLAGS) $(DEBUG_CFLAGS) -DHTTP_GET_APP hdhomerun_http.c -o $@ |
| |
| .PHONY: $(LIBS) |
| $(LIBS): |
| $(MAKE) -C libhdhomerun |
| |
| .PHONY: clean |
| clean: |
| rm -f hdhr_plugin.so hdhomerun get_http *~ |
| $(MAKE) -C libhdhomerun clean |