#######################################################################
#
# Makefile: ascParser library
#
#######################################################################

# include the general makefiles using this directive
GENERALROOT=../../../../
MAKEROOT=../
-include $(GENERALROOT)/general/makefile.all

# the following directive is mandatory in order to get all local stuff into this level
ifeq "$(MAKELEVEL)" "0"


# DEFFLAGS #############################################################

ifndef ISOMP4
ISOMP4 = 1
INCL+= -I$(GENERALROOT)/tools/IsoLib/libisomediafile/src/
INCL+= -I$(GENERALROOT)/tools/IsoLib/mpegh_in_isom/src

ifeq "$(TARGET_SYSTEM)" "Linux"
isomediadir = linux
INCL+= -I$(GENERALROOT)/tools/IsoLib/libisomediafile/linux
else
ifeq "$(TARGET_SYSTEM)" "Darwin"
isomediadir = macosx
INCL+= -I$(GENERALROOT)/tools/IsoLib/libisomediafile/macosx
endif
endif
endif

# DIRECTORIES ##########################################################

SRCDIRS +=  ../src

INCL += -I../include

INCL += -I../../../../tools/cicp2geometry/cicp2geometryLib/include


# SOURCES ##############################################################

OBJS =  ascparser.o ascparser_asc.o ascparser_bitbuf.o ascparser_bitstream.o \
        ascparser_parse.o ascparser_stream_wrap.o ascparser_usacconfig.o ascparser_metadata.o \
        ascparser_mhas.o


# SUMMARIZE VARIABLES ##################################################
OPTIONS  += SRCDIRS="$(SRCDIRS)" INCL="$(INCL)" LIBPATH="$(LIBPATH)" INCLDEP=1 DEFFLAGS="$(DEFFLAGS)" PLOT="$(PLOT)" GPROF="$(GPROF)"


# MAKEFILE RULES AND DEPENDENCIES ######################################
# the first rule `all' has to depend from makefile.all
all: $(GENERALROOT)/general/makefile.all libascParser.a

libascParser.a:
	@$(MAKE) -f Makefile TARGET=$@ $(OPTIONS) COMLIBS="$(LIB_COMLIBS)" CFLAGS="$(CFLAGS)" OBJS="$(OBJS)" library

clean:
	@$(MAKE) TARGET="libascParser.a" OBJS="$(OBJS)" clean

clean_all:
	@$(MAKE) TARGET="libascParser.a" OBJS="$(OBJS)" COMLIBS="$(LIB_COMLIBS)" clean

endif

