Files
bacnet_stack/bacnet-stack/demo/timesync/makefile.b32
T
2007-01-22 20:39:53 +00:00

164 lines
3.9 KiB
Plaintext

#
# Simple makefile to build an executable for Win32
#
# This makefile assumes Borland bcc32 development environment
# on Windows NT/9x/2000/XP
#
!ifndef BORLAND_DIR
BORLAND_DIR_Not_Defined:
@echo .
@echo You must define environment variable BORLAND_DIR to compile.
!endif
PRODUCT = bacts
PRODUCT_EXE = $(PRODUCT).exe
# Choose the Data Link Layer to Enable
DEFINES = -DBACDL_BIP=1;TSM_ENABLED=0;USE_INADDR=0;BIG_ENDIAN=0;PRINT_ENABLED=1
# Directories
BACNET_PORT = ..\..\ports\win32
BACNET_OBJECT = ..\object
BACNET_HANDLER = ..\handler
BACNET_ROOT = ..\..
SRCS = main.c \
$(BACNET_PORT)\bip-init.c \
$(BACNET_ROOT)\bip.c \
$(BACNET_HANDLER)\txbuf.c \
$(BACNET_HANDLER)\noserv.c \
$(BACNET_HANDLER)\h_whois.c \
$(BACNET_HANDLER)\h_iam.c \
$(BACNET_HANDLER)\h_rp.c \
$(BACNET_HANDLER)\h_ts.c \
$(BACNET_HANDLER)\s_ts.c \
$(BACNET_OBJECT)\bacfile.c \
$(BACNET_OBJECT)\device.c \
$(BACNET_OBJECT)\ai.c \
$(BACNET_OBJECT)\ao.c \
$(BACNET_OBJECT)\av.c \
$(BACNET_OBJECT)\bi.c \
$(BACNET_OBJECT)\bo.c \
$(BACNET_OBJECT)\bv.c \
$(BACNET_OBJECT)\lsp.c \
$(BACNET_OBJECT)\mso.c \
$(BACNET_ROOT)\address.c \
$(BACNET_ROOT)\filename.c \
$(BACNET_ROOT)\bacdcode.c \
$(BACNET_ROOT)\bacapp.c \
$(BACNET_ROOT)\bacstr.c \
$(BACNET_ROOT)\bactext.c \
$(BACNET_ROOT)\indtext.c \
$(BACNET_ROOT)\datetime.c \
$(BACNET_ROOT)\whois.c \
$(BACNET_ROOT)\iam.c \
$(BACNET_ROOT)\whohas.c \
$(BACNET_ROOT)\ihave.c \
$(BACNET_ROOT)\rd.c \
$(BACNET_ROOT)\rp.c \
$(BACNET_ROOT)\wp.c \
$(BACNET_ROOT)\arf.c \
$(BACNET_ROOT)\awf.c \
$(BACNET_ROOT)\dcc.c \
$(BACNET_ROOT)\timesync.c \
$(BACNET_ROOT)\datalink.c \
$(BACNET_ROOT)\abort.c \
$(BACNET_ROOT)\reject.c \
$(BACNET_ROOT)\bacerror.c \
$(BACNET_ROOT)\apdu.c \
$(BACNET_ROOT)\npdu.c
OBJS = $(SRCS:.c=.obj)
# Compiler definitions
#
CC = $(BORLAND_DIR)\bin\bcc32 +bcc32.cfg
#LINK = $(BORLAND_DIR)\bin\tlink32
LINK = $(BORLAND_DIR)\bin\ilink32
TLIB = $(BORLAND_DIR)\bin\tlib
#
# Include directories
#
CC_DIR = $(BORLAND_DIR)\BIN
INCL_DIRS = -I$(BORLAND_DIR)\include;$(BACNET_ROOT)\;$(BACNET_OBJECT)\;$(BACNET_HANDLER)\;$(BACNET_PORT)\;.
CFLAGS = $(INCL_DIRS) $(CS_FLAGS) $(DEFINES)
# Libraries
#
C_LIB_DIR = $(BORLAND_DIR)\lib
LIBS = $(C_LIB_DIR)\IMPORT32.lib \
$(C_LIB_DIR)\CW32MT.lib
#
# Main target
#
# This should be the first one in the makefile
all : bcc32.cfg $(PRODUCT_EXE)
install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.
#
# need a temp response file (@&&) because command line is too long
$(PRODUCT_EXE) : $(OBJS)
@echo Running Linker for $(PRODUCT_EXE)
$(LINK) -L$(C_LIB_DIR) -m -c -s -v @&&| # temp response file, starts with |
$(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency
$<
$*.map
$(LIBS)
| # end of temp response file
#
# Utilities
clean :
@echo Deleting obj files, $(PRODUCT_EXE) and map files.
# del $(OBJS) # command too long, bummer!
del *.obj
del $(BACNET_ROOT)\*.obj
del $(BACNET_HANDLER)\*.obj
del $(BACNET_OBJECT)\*.obj
del $(BACNET_PORT)\*.obj
del $(PRODUCT_EXE)
del *.map
del bcc32.cfg
#
# Generic rules
#
.SUFFIXES: .cpp .c .sbr .obj
#
# cc generic rule
#
.c.obj:
$(CC) -o$@ $<
# Compiler configuration file
bcc32.cfg :
Copy &&|
$(CFLAGS)
-c
-y #include line numbers in OBJ's
-v #include debug info
-w+ #turn on all warnings
-Od #disable all optimizations
#-a4 #32 bit data alignment
#-M # generate link map
#-ls # linker options
#-WM- #not multithread
-WM #multithread
-w-aus # ignore warning assigned a value that is never used
-w-sig # ignore warning conversion may lose sig digits
| $@
# EOF: makefile