📄 makefile
字号:
# <LIC_AMD_STD># Copyright (c) 2005 Advanced Micro Devices, Inc.# # This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.# # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA# # The full GNU General Public License is included in this distribution in the# file called COPYING# </LIC_AMD_STD> # <CTL_AMD_STD># </CTL_AMD_STD> # <DOC_AMD_STD># Filename: Makefile# Targets:# libmaimpadec.so - Audio Renderer 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=maimpadec# TOPDIR is the "main" top directoryTOPDIR=../../../../..MAIDIR=$(TOPDIR)/maiMAI_INC=$(MAIDIR)/incifeq ("$(BUILDSDIR)", "")# Default, build under the local directoryBUILDSDIR=.endif# ARCHNAME can be used for CPU specific build options (i.e. mips, i686, etc.)ARCHNAME?=$(strip $(shell uname -m))# TARGETSTARGETFILE1=lib$(COMPNAME).soTARGETFILE2=lib$(COMPNAME).a# If no configuration is specified, "Release" will be usedifeq ("$(BUILD_MODE)", "")BUILD_MODE = releaseendif# Handle "CFG" which is the variable passed by SlickEditifeq ("$(CFG)","Release")BUILD_MODE = releaseendififeq ("$(CFG)","Debug")BUILD_MODE = debugendif# Setup build directories and target file namesBUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)ifeq ("$(BUILD_MODE)", "debug")BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)dbgendififeq ("$(BUILD_MODE)", "release")BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)relendififeq ("$(BUILD_MODE)", "profile")BUILDSSUBDIR=$(BUILDSDIR)/$(ARCHNAME)profendif# TARGETINTDIR is the intermediate path (for object files) TARGETINTDIR1=$(BUILDSSUBDIR)/$(COMPNAME)# TARGETDIR1 is the final path for target executablesTARGETDIR1=$(BUILDSSUBDIR)/$(COMPNAME)TARGETDIR2=$(BUILDSSUBDIR)/$(COMPNAME)/static# TARGETPATH is full target filename with pathTARGETPATH1=$(TARGETDIR1)/$(TARGETFILE1)TARGETPATH2=$(TARGETDIR2)/$(TARGETFILE2)# commands usedMAKE=makeCC=gccCXX=g++LD=ldAR=arCOMPILER=$(CC)LINKER=$(CC)# Common compile/link attributesLDLIBS= -lc -lpthread -ldlLDFLAGS = -shared -Xlinker --no-undefinedCFLAGS=$(GCFLAGS) -O4DEFINES = -DLINUX -DOS_Linux -D_USRDLL -DUSE_MAIDEFINES += -DNDEBUGifeq "$(BUILD_MODE)" "debug"CFLAGS+=-gendififeq ($(ARCHNAME),mips) DEFINES+= -DNDEBUG -D_CONSOLE -DMIPS -D_MBCS -DUSE_TAGGING=1 -DHAVE_STDINT_H=1 -DSTDC_HEADERS=1 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trapendifLSRC = ../..LSRC2 = ..CINC=-I$(LSRC) -I$(LSRC2) -I$(MAI_INC)OBJ = $(TARGETINTDIR1)/mpegaudiodec.o $(TARGETINTDIR1)/mpegaudalloc.o $(TARGETINTDIR1)/mpegaudbits.o \ $(TARGETINTDIR1)/mpegaudgentab.o $(TARGETINTDIR1)/mpegaudtab.o $(TARGETINTDIR1)/mpegaudsynth.o \ $(TARGETINTDIR1)/mpegauddct.o \ $(TARGETINTDIR1)/mai_osal.o $(TARGETINTDIR1)/mai_component.o $(TARGETINTDIR1)/mai_compbase.o \ $(TARGETINTDIR1)/maimpadec.oCOMPILE=$(COMPILER) -c $(CFLAGS) $(DEFINES) -o "$(TARGETINTDIR1)/$(*F).o" $(CINC) "$<"COMPILES=$(COMPILER) -S $(CFLAGS) $(DEFINES) -o "$(TARGETINTDIR1)/$(*F).s" $(CINC) "$<"# Pattern rules$(TARGETINTDIR1)/%.o : $(LSRC)/%.c $(COMPILE) # $(COMPILES)$(TARGETINTDIR1)/%.o : $(LSRC2)/%.c $(COMPILE)$(TARGETINTDIR1)/%.o: $(MAIDIR)/%.c $(COMPILE)$(TARGETINTDIR1)/%.o: $(MAIDIR)/src/%.c $(COMPILE)# Build rulesall: target install# Build target onlytarget: $(TARGETPATH1) $(TARGETPATH2)# Install target in new locationifeq ("$(INSTALLDIR)", "")install:elseinstall: @echo Installing $(COMPNAME) to $(INSTALLDIR)... @mkdir -p $(INSTALLDIR)/static @cp $(TARGETPATH1) $(INSTALLDIR) @cp $(TARGETPATH2) $(INSTALLDIR)/staticendif$(TARGETPATH1): $(TARGETINTDIR1) $(OBJ) mkdir -p "$(TARGETDIR1)" $(LINKER) $(LDFLAGS) -o "$(TARGETPATH1)" $(OBJ) $(LDLIBS)$(TARGETPATH2): $(TARGETINTDIR1) $(OBJ) mkdir -p "$(TARGETDIR2)" $(AR) rcs "$(TARGETPATH2)" $(OBJ)$(TARGETINTDIR1): mkdir -p "$(TARGETINTDIR1)"# Rebuild this projectrebuild: cleanall all# Clean this projectclean: rm -f $(TARGETPATH1) rm -f $(OBJ)# Clean this project and all dependenciescleanall: clean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -