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

📄 makefile

📁 用于DRX3973或DRX39系列的芯片的控制
💻
字号:
###############################################################################
#
# FILE: Makefile
#       This file has been generated.
#
# DESCRIPTION:
#       Builds library and test programs.
#       This file is targeted for GNU make; adapt it to your target system.
#
# $(c) 2004-2005 Micronas GmbH. All rights reserved.
#
# This software and related documentation (the 'Software') are intellectual
# property owned by Micronas and are copyright of Micronas, unless specifically
# noted otherwise.
#
# Any use of the Software is permitted only pursuant to the terms of the
# license agreement, if any, which accompanies, is included with or applicable
# to the Software ('License Agreement') or upon express written consent of
# Micronas. Any copying, reproduction or redistribution of the Software in
# whole or in part by any means not in accordance with the License Agreement
# or as agreed in writing by Micronas is expressly prohibited.
#
# THE SOFTWARE IS WARRANTED, IF AT ALL, ONLY ACCORDING TO THE TERMS OF THE
# LICENSE AGREEMENT. EXCEPT AS WARRANTED IN THE LICENSE AGREEMENT THE SOFTWARE
# IS DELIVERED 'AS IS' AND MICRONAS HEREBY DISCLAIMS ALL WARRANTIES AND
# CONDITIONS WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
# AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIT
# ENJOYMENT, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
# PROPERTY OR OTHER RIGHTS WHICH MAY RESULT FROM THE USE OR THE INABILITY
# TO USE THE SOFTWARE.
#
# IN NO EVENT SHALL MICRONAS BE LIABLE FOR INDIRECT, INCIDENTAL, CONSEQUENTIAL,
# PUNITIVE, SPECIAL OR OTHER DAMAGES WHATSOEVER INCLUDING WITHOUT LIMITATION,
# DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
# INFORMATION, AND THE LIKE, ARISING OUT OF OR RELATING TO THE USE OF OR THE
# INABILITY TO USE THE SOFTWARE, EVEN IF MICRONAS HAS BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGES, EXCEPT PERSONAL INJURY OR DEATH RESULTING FROM
# MICRONAS' NEGLIGENCE.                                                        $
#
# AUTHOR:
# Martin Sinot
#
###############################################################################

#
# This Makefile is targeted for GNU make (cygwin)
#

.PHONY:	all clean cleanall

#######################################
#
# Translator section
# Adapt for your target system
#
#######################################
# Adapt CC and CCFLAGS for your compiler
CC=gcc
CPP=gcc
CFLAGS=-O2 -Wall
CFLAGS+= -D USE_DUMMY_MT2060 -D USE_DUMMY_MT2121 -D USE_DUMMY_XC3028


# Adapt LD and LDFLAGS for your linker
LD=gcc
LDFLAGS=

# Adapt LIB and LIBFLAGS for your librarian
LIB=ar
LIBFLAGS=rcsuv

#######################################
#
# Library target
#
#######################################
DRXDRIVER_LIB=libdrxdriver.a
SRC_DRXDRIVER_LIB= bsp_host.c bsp_i2c.c bsp_tuner.c tuner5byte.c tunermt2060.c tunermt2121.c mt_userdef.c tunerxc3028.c drx_driver.c drx_dap_wasi.c drx3973d.c
#SRC_DRXDRIVER_LIB+= mt2060.c mt_spuravoid.c xc3028_control.c
OBJ_DRXDRIVER_LIB=$(SRC_DRXDRIVER_LIB:.c=.o)


#######################################
#
# Targets
#
#######################################

SRC_i2c_test=i2c_test.c
OBJ_i2c_test= $(SRC_i2c_test:.c=.o)
TARGET_i2c_test=i2c_test.exe

SRC_example_full=example_full.c
OBJ_example_full= $(SRC_example_full:.c=.o)
TARGET_example_full=example_full.exe

SRC_example_pip=example_pip.c
OBJ_example_pip= $(SRC_example_pip:.c=.o)
TARGET_example_pip=example_pip.exe

SRC_example_scan=example_scan.c
OBJ_example_scan= $(SRC_example_scan:.c=.o)
TARGET_example_scan=example_scan.exe

SRC_example_simple=example_simple.c
OBJ_example_simple= $(SRC_example_simple:.c=.o)
TARGET_example_simple=example_simple.exe


SRC_ALL_TEST= $(SRC_i2c_test) $(SRC_example_full) $(SRC_example_pip) $(SRC_example_scan) $(SRC_example_simple)
OBJ_ALL_TEST=$(SRC_ALL_TEST:.c=.o)
TARGETS_ALL_TEST= $(TARGET_i2c_test) $(TARGET_example_full) $(TARGET_example_pip) $(TARGET_example_scan) $(TARGET_example_simple)


#######################################
#
# Dependency files
#
#######################################
SOURCES=$(SRC_DRXDRIVER_LIB) $(SRC_ALL_TEST)
OBJECTS=$(SOURCES:.c=.o)
DEPENDENCIES=$(SOURCES:.c=.d)


#######################################
#
# Rules section
#
#######################################
all: $(DRXDRIVER_LIB) $(TARGETS_ALL_TEST)

# Translate .c files (source) to .o files (object)
.c.o:
	$(CC) $(CFLAGS) -c $<

# Build .d files (dependency) from .c files (source), to
# provide an automatic dependency generation.
#
# This is done by feeding the source file in gcc -M, which
# produces a dependency list for the source file, as follows:
#
# gcc -M source.c -->
# source.o : source.c header.h header2.h ...
#
# This list is then fed into sed, which edits the first line
# to add the dependency of the dependency file itself. Thus,
# the above line becomes
#
# source.o source.d : source.c header.h header2.h ...
#
# The output is copied to the dependency file (in this case,
# source.d). Finally, all dependency files thus created are
# included in this Makefile.
%.d: %.c
	@$(SHELL) -ec '$(CPP) -M $(CFLAGS) $< \
	| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
	[ -s $@ ] || rm -f $@'

clean:
	rm -rf $(DEPENDENCIES) $(OBJECTS)

cleanall: clean
	rm -rf $(TARGETS_ALL_TEST) $(DRXDRIVER_LIB)

$(DRXDRIVER_LIB): $(OBJ_DRXDRIVER_LIB)
	$(LIB) $(LIBFLAGS) $@ $^

$(TARGET_i2c_test): $(OBJ_i2c_test) $(DRXDRIVER_LIB)
	$(LD) $(LDFLAGS) -o $@ $+

$(TARGET_example_full): $(OBJ_example_full) $(DRXDRIVER_LIB)
	$(LD) $(LDFLAGS) -o $@ $+

$(TARGET_example_pip): $(OBJ_example_pip) $(DRXDRIVER_LIB)
	$(LD) $(LDFLAGS) -o $@ $+

$(TARGET_example_scan): $(OBJ_example_scan) $(DRXDRIVER_LIB)
	$(LD) $(LDFLAGS) -o $@ $+

$(TARGET_example_simple): $(OBJ_example_simple) $(DRXDRIVER_LIB)
	$(LD) $(LDFLAGS) -o $@ $+

# Do not include dependencies when make target is clean
ifeq ($(MAKECMDGOALS),clean)
NODEPEND=1
endif

# Do not include dependencies when make target is cleanall
ifeq ($(MAKECMDGOALS),cleanall)
NODEPEND=1
endif

ifndef NODEPEND
-include $(DEPENDENCIES)
endif

⌨️ 快捷键说明

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