Makefile for BACnet protocol stack Analysis

Source: Internet
Author: User

Makefile reference books <GNU make project management>

# Cc = gcc
# AR = ar
# Make = make
# Size = size

# Configuration

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

#-D indicates the reference meaning, 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 is enabled by default. If you want to use MS/TP, you must

# Use 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

# Define the bbmd type to be supported

Bbmd_define? =-Dbbmd_enabled = 1
# Bbmd_define? =-Dbbmd_enabled = 0
# Bbmd_define? =-Dbbmd_client_enabled

# Passing parameters through command lines

Make_define? =

# I don't know what weak_func is.

Defines = $ (bacnet_defines) $ (bacdl_define) $ (bbmd_define)-dweak_func =
Defines + = $ (make_define)

# The default directory is/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
# Compiler Configuration

# 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 variable

# (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

# Add the desired development board type, such as at91sam7s and 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.