
##############################################################################
#                                                                            #
#                  IMPINJ CONFIDENTIAL AND PROPRIETARY                       #
#                                                                            #
# This source code is the sole property of Impinj, Inc.  Reproduction or     #
# utilization of this source code in whole or in part is forbidden without   #
# the prior written consent of Impinj, Inc.                                  #
#                                                                            #
# (c) Copyright Impinj, Inc. 2009. All rights reserved.                      #
#                                                                            #
##############################################################################


##############################################################################
#
# $Id: SConscript 66189 2010-12-04 01:51:32Z dshaheen $
# 
#  Description: Build script that builds the rfid library live sample
#      
#
##############################################################################


Import("env", "buildos", "transportdir", "installdir")

# Make a copy of the environment
localEnv = env.Clone()

sources = [ "blockwrite.c" ] 

# Add project-specific, platform-independent include directories, libraries,
# and library paths
localEnv["CPPPATH"] += [ "../include",
                         "../../include",
                         "../../include/"+buildos,
                         "../../../include/"+buildos ]
localEnv["LIBS"]    += [ "rfid",
                         "rfidtx",
                         "cpl",
                         "sample_shared"  ]
localEnv["LIBPATH"] += [ "../..",
                         "../../../transport/library/"+transportdir,
                         "../../../compat/"+buildos,
                         "../shared"  ]

#
# Linux-specific build flags
if "linux" == buildos:
    #
    # Add linux-specific libraries
    localEnv["LIBS"] += [ "pthread",
                          "rt",
                          "stdc++" ]
    #
    # Add shared-library search path
    localEnv["RPATH"] = localEnv["LIBPATH"]
    #
    # Add linux-specific preprocessor defines
    localEnv["CPPDEFINES"].update({ "_GNU_SOURCE" : 1 })
    #
    # MontaVista-specific build flags
    if env["mv"]:
        #
        # Add MV-specific preprocessor defines
        localEnv["CPPDEFINES"].update({ "COMPILE_BIG_ENDIAN" : 1 })
#
# Windows-specific build flags
elif "windows" == buildos:
    #
    # Add Windows-specific preprocessor defines
    #localEnv["CPPDEFINES"].update({ "_CRT_SECURE_NO_DEPRECATE" : 1 })
    #
    # Common console application defines
    localEnv["CPPDEFINES"].update(env["COMMONCONDEFS"])
    #
    # If debug build, set program database for debug symbols
    if env["debug"]:
        localEnv["PDB"] = "nvmemupd.pdb"
    else:
        localEnv["PDB"] = ""
    #
    # CE-specifid build flags
    if env["ce"]:
        localEnv["LINKFLAGS"] += env["ceamainentry"]

# Build the executable
localEnv.Program("blockwrite", sources)
env.Append(TAR_DEPEND_LIST = Install(dir = installdir, source = [ "blockwrite" ]))
env.Append(TAR_LIST = "blockwrite")
