1fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin# Debug Flags:
2fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin#     0 - NO DEBUG MESSAGES
3fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin#     1 - DEBUG MESSAGES are enabled
4fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
5fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinOMX_DEBUG ?= 0      # master switch: turn debug on or off
6fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
7fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinSRC=\
8fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	OMX_JpegDec_Thread.c \
9fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	OMX_JpegDec_Utils.c \
10fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	OMX_JpegDecoder.c 
11fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinHSRC=$(wildcard ../inc/*)
12fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
13fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinOBJ=$(SRC:.c=.o)
14fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
15fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavininclude $(OMXROOT)/Master.mk
16fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
17fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinCFLAGS+=-I../inc -I$(OMXINCLUDEDIR) -I$(SYSTEMINCLUDEDIR) -I$(BRIDGEINCLUDEDIR) -Wall -fpic -pipe -DOMX_DEBUG -DFUNC 
18fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinifeq ($(OMX_DEBUG), 1)
19fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin    CFLAGS += -O0
20fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinelse
21fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin    CFLAGS += -O2
22fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinendif
23fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
24fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinifeq ($(OMX_DEBUG), 1)
25fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin    CFLAGS += -DOMX_DEBUG=1
26fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinendif
27fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
28fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinOMXCORE_LIB=$(OMXLIBDIR)/libOMX_Core.so
29fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinCOMPONENT_LIB=libOMX.TI.JPEG.decode.so
30fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
31fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz ZavinCOMPONENT_TARGET=$(OMXLIBDIR)/$(COMPONENT_LIB)
32fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
33fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinall install:: $(COMPONENT_TARGET)
34fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
35fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinomxcore $(COMPONENT_TARGET): $(COMPONENT_LIB) $(OMXLIBDIR) $(OMXCORE_LIB)
36fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	@echo "Installing $(COMPONENT_LIB)"
37fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	cp -f $(COMPONENT_LIB) $(COMPONENT_TARGET)
38fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
39fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin$(COMPONENT_LIB): $(OBJ) 
40fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	$(CROSS)gcc $(CFLAGS) -shared -o $(COMPONENT_LIB) $(OBJ) -L$(OMXLIBDIR) -ldl -lpthread -lOMX_ResourceManagerProxy
41fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
42fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin$(SRC): $(HSRC)
43fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
44fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinclean:: 
45fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	rm -f $(COMPONENT_LIB)
46fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	rm -f $(OBJ)
47fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
48fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavindistclean:: clean
49fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin
50fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavinclobber:: clean
51fb3766f18a2c18b6f4798a6a631fdb88fcacd1dcRebecca Schultz Zavin	rm -f $(OMXLIBDIR)/$(COMPONENT_LIB)
52