📄 makefile
字号:
# <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:# dumpviewer - MAI Dump Viewer app## 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)## Example make usage:# Build app and all dependent components: make all# Build into a specific directory: make all BUILDSDIR=/usr/local/builds# Build debug: make all BUILD_MODE=debug# Pass compile options to entire Build: make all GCFLAGS="-DVERSION=0x0010"# </DOC_AMD_STD> COMPNAME=dumpviewer# TOPDIR is the MAEforTravis top directoryTOPDIR=../../../..MAIDIR=$(TOPDIR)/maiMAI_INC = $(MAIDIR)/inc# RUNTIMELIBSDIR is the directory search path for the MAI shared librariesRUNTIMELIBSDIR=.# BUILDSDIR must be full path because it's passed to sub-makefilesifeq ("$(BUILDSDIR)", "")# Default, build under the local directoryBUILDSDIR=$(shell pwd)endif# ARCHNAME can be used for CPU specific build options (i.e. mips, i686, etc.)ARCHNAME?=$(strip $(shell uname -m))# TARGETS (must differ from COMPNAME)TARGETFILE1=maidumpviewer# If no configuration is specified, "release" will be usedifeq ("$(BUILD_MODE)", "")BUILD_MODE = releaseendif# GCFLAGS: Global compile flags passed to all Makefilesifndef "GCFLAGS"GCFLAGS = endif# 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)# TARGETDIR is the final path for target executablesTARGETDIR1=$(BUILDSSUBDIR)# TARGETPATH is full target filename with pathTARGETPATH1=$(TARGETDIR1)/$(TARGETFILE1)ifeq ("$(INSTALLDIR)", "")INSTALLDIR=$(TARGETDIR1)endifLSRC = ../..# toolsCC=gccCXX=g++LD=ldCOMPILER=$(CC)LINKER=$(CC)# Common compile/link attributesDEFINES = -DLINUXLDPATH = -L$(TARGETDIR1)LDLIBS = -ldl -lpthread# "rpath": At run-time control the search path for shared librariesLDFLAGS= -Xlinker '-rpath=$(RUNTIMELIBSDIR)'# "rpath-link": During link used locally built libraries (avoid the unknwon in /usr/lib)LDFLAGS+= -Xlinker '-rpath-link=$(TARGETDIR1)'CFLAGS = $(GCFLAGS)ifeq ("$(BUILD_MODE)","debug")CFLAGS+=-gendififeq ("$(BUILD_MODE)","profile")CFLAGS+=-pgendififeq ($(ARCHNAME),mips)DEFINES+=-DMIPSendifCINC=-I$(LSRC) -I$(MAI_INC)OBJS=$(TARGETINTDIR1)/mai_osal.o $(TARGETINTDIR1)/dumpviewer.oCOMPILE=$(COMPILER) -c $(CFLAGS) $(DEFINES) -o "$(TARGETINTDIR1)/$(*F).o" $(CINC) "$<"MAILIBSDIR=$(TOPDIR)/liball: dep target# Build target onlytarget: $(TARGETPATH1) # Install target in new location if specifiedifeq ("$(INSTALLDIR)", "")install:elseinstall: @echo Installing $(COMPNAME) to $(INSTALLDIR)... @mkdir -p $(INSTALLDIR) @cp $(TARGETPATH1) $(INSTALLDIR)endif$(TARGETPATH1) : $(TARGETINTDIR1) $(OBJS) $(LINKER) $(LDFLAGS) -o $(TARGETPATH1) $(OBJS) $(LDPATH) $(LDLIBS)$(TARGETINTDIR1): mkdir -p "$(TARGETINTDIR1)"$(TARGETINTDIR1)/%.o: $(LSRC)/%.c $(MAI_INC)/*.h $(COMPILE)$(TARGETINTDIR1)/%.o: $(MAIDIR)/src/%.c $(COMPILE)dep: mkdir -p $(TARGETDIR1)# Clean this projectclean: /bin/rm -f $(OBJS) /bin/rm -f $(TARGETPATH1)# Clean this project and all dependenciescleanall: clean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -