📄 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:# libmaifilewriter.so - File Writer 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=maifilewriter# 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=$(LD)# Common compile/link attributesLDLIBS=-lc -lpthread -ldlLDFLAGS = -shared --no-undefinedCFLAGS=$(GCFLAGS)DEFINES = -DLINUX=1 -DOS_Linux -D_USRDLL -D_XOPEN_SOURCE=500ifeq "$(BUILD_MODE)" "debug"CFLAGS+=-gendifLSRC = ..CINC = -I$(LSRC) -I$(MAI_INC)OBJS = $(TARGETINTDIR1)/maifilewriter.o $(TARGETINTDIR1)/mai_osal.o COMPILE=$(COMPILER) -c $(CFLAGS) $(DEFINES) -o "$(TARGETINTDIR1)/$(*F).o" $(CINC) "$<"# 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) $(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: $(MAIDIR)/src/%.c $(COMPILE)# Rebuild this projectrebuild: cleanall all# Clean this projectclean: @rm -f $(TARGETPATH1) @rm -f $(OBJS)# Clean this project and all dependenciescleanall: clean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -