BACnet協議棧分析之Makefile檔案

來源:互聯網
上載者:User

Makefile參考書籍<GNU make專案管理>

# CC = gcc
# AR = ar
# MAKE = make
# SIZE = size

# 配置

# If BACNET_DEFINES has not already been set, configure to your needs here

# -D 表示引用意思,PRINT_ENABLE=1, BACAPP_ALL, BACFILE, INTRINSIC_REPORTING

MY_BACNET_DEFINES = -DPRINT_ENABLED=1
MY_BACNET_DEFINES += -DBACAPP_ALL
MY_BACNET_DEFINES += -DBACFILE
MY_BACNET_DEFINES += -DINTRINSIC_REPORTING
BACNET_DEFINES ?= $(MY_BACNET_DEFINES)

# un-comment the next line to build the routing demo application BACNET預設是開啟BACnet IP協議,若想使用MS/TP則需

#使用BACDL_DEFINE=-DBACDL_MSTP=1
#BACNET_DEFINES += -DBAC_ROUTING

#BACDL_DEFINE=-DBACDL_ETHERNET=1
#BACDL_DEFINE=-DBACDL_ARCNET=1
#BACDL_DEFINE=-DBACDL_MSTP=1
BACDL_DEFINE?=-DBACDL_BIP=1

# 定義要支援的BBMD的類型

BBMD_DEFINE ?= -DBBMD_ENABLED=1
#BBMD_DEFINE ?=-DBBMD_ENABLED=0
#BBMD_DEFINE ?= -DBBMD_CLIENT_ENABLED

# 通過命令列來傳遞參數

MAKE_DEFINE ?=

# 不知道WEAK_FUNC有什麼用

DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) $(BBMD_DEFINE) -DWEAK_FUNC=
DEFINES += $(MAKE_DEFINE)

# 預設是/ports/linux目錄

BACNET_PORT ?= linux
BACNET_PORT_DIR = ../ports/${BACNET_PORT}

BACNET_OBJECT = ../demo/object
BACNET_HANDLER = ../demo/handler
BACNET_CORE = ../src
BACNET_INCLUDE = ../include
# 編譯器配置

#STANDARDS = -std=c99
INCLUDE1 = -I$(BACNET_PORT_DIR) -I$(BACNET_OBJECT) -I$(BACNET_HANDLER)
INCLUDE2 = -I$(BACNET_INCLUDE)
INCLUDES = $(INCLUDE1) $(INCLUDE2)
OPTIMIZATION = -Os
DEBUGGING =
WARNINGS = -Wall -Wmissing-prototypes
ifeq (${BUILD},debug)
OPTIMIZATION = -O0
DEBUGGING = -g -DDEBUG_ENABLED=1
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
DEFINES += -DBIP_DEBUG
endif
endif
CFLAGS  = $(WARNINGS) $(DEBUGGING) $(OPTIMIZATION) $(STANDARDS) $(INCLUDES) $(DEFINES)

# export匯出變數

# (see http://www.gnu.org/software/automake/manual/make/Special-Targets.html)
.EXPORT_ALL_VARIABLES:

all: library demos
.PHONY : all library demos clean

library:
 $(MAKE) -C lib all

demos:
 $(MAKE) -C demo all

# 增加想要的開發板類型,比如at91sam7s,atmega168

ports: atmega168 bdk-atxx4-mstp at91sam7s
 @echo "Built the ARM7 and AVR ports"

atmega168: ports/atmega168/Makefile
 $(MAKE) -C ports/atmega168 clean all

at91sam7s: ports/at91sam7s/makefile
 $(MAKE) -C ports/at91sam7s clean all

bdk-atxx4-mstp: ports/bdk-atxx4-mstp/Makefile
 $(MAKE) -C ports/bdk-atxx4-mstp clean all

clean:
 $(MAKE) -C lib clean
 $(MAKE) -C demo clean

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.