⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 mpeg4 demux 代码
💻
字号:
# <LIC_AMD_STD>
# Copyright (C) 2003-2005 Advanced Micro Devices, Inc.  All Rights Reserved.
#
# Unless otherwise designated in writing, this software and any related
# documentation are the confidential proprietary information of AMD.
# THESE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY
# UNLESS OTHERWISE NOTED IN WRITING, EXPRESS OR IMPLIED WARRANTY OF ANY
# KIND, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
# NONINFRINGEMENT, TITLE, FITNESS FOR ANY PARTICULAR PURPOSE AND IN NO
# EVENT SHALL AMD OR ITS LICENSORS BE LIABLE FOR ANY DAMAGES WHATSOEVER.
#
# AMD does not assume any responsibility for any errors which may appear
# in the Materials nor any responsibility to support or update the
# Materials.  AMD retains the right to modify the Materials at any time,
# without notice, and is not obligated to provide such modified
# Materials to you. AMD is not obligated to furnish, support, or make
# any further information available to you.
# </LIC_AMD_STD>
# <CTL_AMD_STD>
# </CTL_AMD_STD>
# <DOC_AMD_STD>
# Filename: makefile
# Targets:
#    libmaimp4demux.so -  MPEG4 Demux MAI component shared lib
#
# Inputs (optional):
#    BUILD_MODE: release, debug, profile
#    BUILDSDIR:  top level output directory (binaries)
#    INSTALLDIR:  directory to copy final target
#    GCFLAGS: global compile flags (passed to all makefiles)
# </DOC_AMD_STD>

COMPNAME=maimp4demux
# TOPDIR is the "main" top directory
TOPDIR=../../../..
MAIDIR = $(TOPDIR)/mai
MAI_INC=$(MAIDIR)/inc

ifeq ("$(BUILDSDIR)", "")
# Default, MAI Components all go to same top level builds directory
#BUILDSDIR=../../../../../../../builds
BUILDSDIR=./
endif
# ARCHNAME can be used for CPU specific build options (i.e. mips, i686, etc.)
ARCHNAME=$(strip $(shell uname -m))
# TARGETS
TARGETFILE1=lib$(COMPNAME).so
TARGETFILE2=lib$(COMPNAME).a

# If no configuration is specified, "Release" will be used
ifeq ("$(BUILD_MODE)", "")
BUILD_MODE = release
endif
# Handle "CFG" which is the variable passed by SlickEdit
ifeq ("$(CFG)","Release")
BUILD_MODE = release
endif
ifeq ("$(CFG)","Debug")
BUILD_MODE = debug
endif

# Setup build directories and target file names
BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)
ifeq ("$(BUILD_MODE)","debug")
BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)dbg
endif
ifeq ("$(BUILD_MODE)","release")
BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)rel
endif
ifeq ("$(BUILD_MODE)","profile")
BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)prof
endif

# TARGETINTDIR is the intermediate path (for object files)
 TARGETINTDIR1=$(BUILDSSUBDIR)/$(COMPNAME)
# TARGETDIR1 is the final path for target executables
TARGETDIR1=$(BUILDSSUBDIR)/$(COMPNAME)
TARGETDIR2=$(BUILDSSUBDIR)/$(COMPNAME)/static
# TARGETPATH is full target filename with path
TARGETPATH1=$(TARGETDIR1)/$(TARGETFILE1)
TARGETPATH2=$(TARGETDIR2)/$(TARGETFILE2)

# commands used
MAKE=make
CC=gcc
CXX=g++
LD=ld
AR=ar

COMPILER=$(CC)
LINKER=$(CXX)

# Common compile/link attributes
LDLIBS=-lc -lpthread -ldl
LDFLAGS = -shared
CFLAGS=$(GCFLAGS)
DEFINES = -DLINUX=1 -DOS_Linux -D_USRDLL -D_XOPEN_SOURCE=500
DEFINES += -DVIDEO_ES -DAUDIO_ES -DTURING_FAST

ifeq "$(BUILD_MODE)" "debug"
CFLAGS+=-g
endif

LSRC = ../..

CINC =  -I$(LSRC)  -I$(MAI_INC)

OBJS = $(TARGETINTDIR1)/mai_osal.o 		\
	$(TARGETINTDIR1)/mai_component.o 	\
	$(TARGETINTDIR1)/maimp4demux.o 		\
	$(TARGETINTDIR1)/atomparse.o		\
	$(TARGETINTDIR1)/mp4parse.o		\
	$(TARGETINTDIR1)/mp4util.o		\
	$(TARGETINTDIR1)/descriptors.o

COMPILE=$(COMPILER) -c $(CFLAGS) $(DEFINES) -o "$(TARGETINTDIR1)/$(*F).o" $(CINC) "$<"

# Build rules
all: target install

# Build target only
target: $(TARGETPATH1) $(TARGETPATH2)

# Install target in new location
ifeq ("$(INSTALLDIR)", "")
install:
else
install:
	@echo Installing $(COMPNAME) to $(INSTALLDIR)...
	@mkdir -p $(INSTALLDIR)/static
	@cp $(TARGETPATH1) $(INSTALLDIR)
	@cp $(TARGETPATH2) $(INSTALLDIR)/static
endif

$(TARGETPATH1):	$(TARGETINTDIR1) $(OBJS) makefile
	mkdir -p "$(TARGETDIR1)"
	$(LINKER) $(LDFLAGS) -o "$(TARGETPATH1)" $(OBJS) $(LDLIBS)

$(TARGETPATH2): $(TARGETINTDIR1) $(OBJS)
	mkdir -p "$(TARGETDIR2)"
	$(AR) rcs "$(TARGETPATH2)" $(OBJS)

$(TARGETINTDIR1):
	mkdir -p "$(TARGETINTDIR1)"

$(TARGETINTDIR1)/%.o:	$(LSRC)/%.c $(MAI_INC)/*.h
	$(COMPILE)

$(TARGETINTDIR1)/%.o:	$(LSRC)/%.cpp
	$(COMPILE)

$(TARGETINTDIR1)/%.o:	$(LSRC)/turing/%.cpp
	$(COMPILE)

$(TARGETINTDIR1)/%.o:	$(MAIDIR)/%.c
	$(COMPILE)

# Rebuild this project
rebuild: cleanall all

# Clean this project
clean:
	@rm -f $(TARGETPATH1)
	@rm -f $(OBJS)

# Clean this project and all dependencies
cleanall: clean

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -