#****************************************************************************
#      COPYRIGHT (c) 1997 Airsys ATM, Inc. Kansas City, Mo. USA             *
#                                                                           *
#               GBAS MMS Environmental Parameter Makefile                   *
#                       gnu make version 3.79.1                             *
#           ===============================================                 *
#                                                                           *
#   Purpose:    Updates the environmental varible input file based on any   *
#               inputs to the makefile.  If the environmental variable      *
#               input file does not exist, it is created, with the defaults *
#               depending on the inputs to thie makefile                    *
#                                                                           *
#   Outputs:    Updated environmental variable file                         *
#                                                                           *
#   Env Param:  Any environmental parameter used in this file may be        * 
#               overridden by specifying it on the command line.  The       *
#               variables output to the environ.txt file are the ones that  *
#               are intended to be overridden on the command line.          *
#               Overriding other parameters can cause unintended side       *
#               effects. If the variable is not specified on the command    *
#               line and is not defined in the current ENVFILE, the default *
#               will be used                                                *
#               Example:                                                    *
#                 make "VERSION=1.0"                                        *
#               All directories must be specified as relative paths         *
#                                                                           *
#****************************************************************************
#                               -- NOTICE --            ALL RIGHTS RESERVED *
#  No part of this software may be reproduced or modified in any form or by *
#  any means without the prior written consent of Airsys ATM Inc.           *
#****************************************************************************

all :  updateEnv

ENVFILE = test.txt

# Tool parameters and their defaults
CADUL_ROOT = H:\gbas\tools\cadul\1.0
LINT_ROOT = H:\gbas\tools\lint
CRC_ROOT = H:\gbas\tools\checkExe\1.0
PVCS_ROOT = H:\gbas\tools\pvcs\6.7.10
PVCSARCH = H:\gbas\code_control\pvcs_arc

# Directory parameters and their defaults
RELDIR = .
BUILDDIR = bld
SRCDIR = source
INCLDIR = source

# Miscellaneous parameters and their defaults
VERSION = 0.0
CSCI = DGIM
CSCI_TYPE = OMF

# Library parameters and their defaults
OSLIBDIR = H:\gbas\Approved_Software\os
SSLIBDIR = H:\gbas\Approved_Software\ss
FSLIBDIR = H:\gbas\Approved_Software\filesys
CMLIBDIR = H:\gbas\Approved_Software\common

# CSCI specific compiler options and their defaults
CFG_VER = $(VERSION)
LOGMSG = 0xffffffff
LOGEVENT = 0xffff0000
LOGERROR = 0xffffffff
LOGDATA = 0x1
LOGSATDATA = 0
LOGCIDATA = 0
LOGCISATDATA = 0
LOGTASKUTIL = 0
STATUS_PORT = COM1
STATUS_BAUD = B115200
TASK_UTIL = FALSE
D8PSK_VENDOR = TELERAD

#*****************************************************************
#***               Rebuild the environ.txt file               ****
#*****************************************************************
.PHONY: updateEnv
updateEnv :
	@echo Rebuilding $(ENVFILE)
	@echo #**************************************************************************** >  $(ENVFILE)
	@echo # COPYRIGHT (c) 1997 Airsys ATM, Inc. Kansas City, Mo. USA                    >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo # $(CSCI) Executable Build Environment Macros                                 >>  $(ENVFILE)
	@echo # =======================================                                     >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo # Purpose : Defines the build environment for the $(CSCI) build               >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo # Outputs : None                                                              >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo # Notes : Each section defines the purpose for each macro.  The user should   >>  $(ENVFILE)
	@echo # - verify the settings in this file prior to initiating a build.             >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #  -------------------------------- NOTICE -------------- ALL RIGHTS RESERVED >>  $(ENVFILE)
	@echo #  No part of this software may be reproduced or modified in any form or by   >>  $(ENVFILE)
	@echo #  any means without the prior written consent of Airsys ATM Inc.             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #************************** Setup of the Toolset **************************** >>  $(ENVFILE)
	@echo # CSCI - Abbreviation for the CSCI (case sensitive), OS, SS, CM, FS, MMS,     >>  $(ENVFILE)
	@echo # - DGRU, DGIM                                                                >>  $(ENVFILE)
	@echo # CADUL_ROOT - points to the CADUL toolset                                    >>  $(ENVFILE)
	@echo # PVCS_ROOT - points to the PVCS toolset                                      >>  $(ENVFILE)
	@echo # CRC_ROOT - points to the CRCGEN toolset                                     >>  $(ENVFILE)
	@echo # LINT_ROOT - points to the LINT toolset (development tool, not required to build) >>  $(ENVFILE)
	@echo # PVCSARCH - points to the root of the Common PVCS archive directory          >>  $(ENVFILE)
	@echo # - enter NULL if no PVCS archive is to be used                               >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo CSCI = $(CSCI)>>  $(ENVFILE)
	@echo CSCI_TYPE = $($(CSCI)_TYPE)>>  $(ENVFILE)
	@echo CADUL_ROOT = $(CADUL_ROOT)>>  $(ENVFILE)
	@echo PVCS_ROOT = $(PVCS_ROOT)>>  $(ENVFILE)
	@echo CRC_ROOT = $(CRC_ROOT)>>  $(ENVFILE)
	@echo LINT_ROOT = $(LINT_ROOT)>>  $(ENVFILE)
	@echo PVCSARCH = $(PVCSARCH)>>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #************************** Compiler Switches ******************************* >>  $(ENVFILE)
	@echo # LOGMSG - set to a bit map to enable miscellaneous messages by CSC           >>  $(ENVFILE)
	@echo # LOGEVENT - set to a bit map to enable event logging by CSC                  >>  $(ENVFILE)
	@echo # LOGERROR - set to a bit map to enable error logging by CSC                  >>  $(ENVFILE)
	@echo # LOGDATA - set to a bit map to enable logging for generic parameters         >>  $(ENVFILE)
	@echo # LOGSATDATA - set to a bit map to enable logging for satellite parameters    >>  $(ENVFILE)
	@echo # LOGCIDATA - set to a bit map to enable logging for ci parameters            >>  $(ENVFILE)
	@echo # LOGCISATDATA - set to a bit map to enable logging for ci/satellite parameters >>  $(ENVFILE)
	@echo # LOGTASKUTIL - set to a bit map to enable task utilization logging by CSC    >>  $(ENVFILE)
	@echo # STATUS_PORT - Port for the status logging, see sscm_comdrv.h for port ids   >>  $(ENVFILE)
	@echo # STATUS_BAUD - baud rate for the status logging, see sscm_comdrv.h for rates >>  $(ENVFILE)
	@echo # TASK_UTIL - enable (= TRUE) task utilization logging, or disable (= FALSE)  >>  $(ENVFILE)
	@echo # # note - the bld file must also be altered whenever this value changes      >>  $(ENVFILE)
	@echo # COM2_DEBUG - bit map for the debug capability that is enabled.              >>  $(ENVFILE)
	@echo # - Bit 0 : Enable Time Logging                                               >>  $(ENVFILE)
	@echo # - Bit 1 : Enable IO Port Logging                                            >>  $(ENVFILE)
	@echo # - Bit 2 : Enable Zilog Chip debug                                           >>  $(ENVFILE)
	@echo # - Bit 3 : Enable File System debug                                          >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo LOGMSG = $(LOGMSG)>>  $(ENVFILE)
	@echo LOGEVENT = $(LOGEVENT)>>  $(ENVFILE)
	@echo LOGERROR = $(LOGERROR)>>  $(ENVFILE)
	@echo LOGDATA = $(LOGDATA)>>  $(ENVFILE)
# The next four lines do not get written!
	@echo LOGSATDATA = $(LOGSATDATA)>>$(ENVFILE)
	@echo LOGCIDATA = $(LOGCIDATA)>>  $(ENVFILE)
	@echo LOGCISATDATA = $(LOGCISATDATA)>>  $(ENVFILE)
	@echo LOGTASKUTIL = $(LOGTASKUTIL)>>  $(ENVFILE)
	@echo STATUS_PORT = $(STATUS_PORT)>>  $(ENVFILE)
	@echo STATUS_BAUD = $(STATUS_BAUD)>>  $(ENVFILE)
	@echo TASK_UTIL = $(TASK_UTIL)>>  $(ENVFILE)
	@echo COM2_DEBUG = $(COM2_DEBUG)>>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #**************************** Directory Structure *************************** >>  $(ENVFILE)
	@echo # The directory structure is used to specify the location of the directories  >>  $(ENVFILE)
	@echo # to be used for the various inputs and outputs of the build process. This    >>  $(ENVFILE)
	@echo # file must be located in the same directory as the makefile and must be the  >>  $(ENVFILE)
	@echo # directory from which the nmake command is executed.  All directories are    >>  $(ENVFILE)
	@echo # specified relative to this file's directory without the leading "\"         >>  $(ENVFILE)
	@echo # if there are any spaces in the directory name, specify the 8 char dos name  >>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo # RELDIR : Build output directory where the lib file will be written. The map >>  $(ENVFILE) 
	@echo # - file and a copy of this file will be placed in that directory as well so  >>  $(ENVFILE)
	@echo # - that a record of the configuration used to build this library             >>  $(ENVFILE)
	@echo # SRCDIR : Build input directory where all the source code resides            >>  $(ENVFILE)
	@echo # BUILDDIR : Build output directory where the obj files will be written       >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo RELDIR = $(RELDIR)>>$(ENVFILE)
	@echo SRCDIR = $(SRCDIR)>>$(ENVFILE)
	@echo INCLDIR = $(INCLDIR)>>  $(ENVFILE)
	@echo BUILDDIR = $(BUILDDIR)>>  $(ENVFILE)
	@echo #                                                                             >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo #******************************* Version ************************************ >>  $(ENVFILE)
	@echo # if there are any spaces in the directory name, specify the 8 char dos name  >>  $(ENVFILE)
	@echo # VERSION - Indicates the version of the software being built                 >>  $(ENVFILE)
	@echo # D8PSK_VENDOR - Indicates the D8Psk equipment used HARRIS or TELERAD         >>  $(ENVFILE)
	@echo # GPS_VENDOR - Indicates the GPS equipment used, ASHTECH or NOVATEL           >>  $(ENVFILE)
	@echo # TEST_CFG_VER - Indicates the last version in which the TEST cfg changed     >>  $(ENVFILE)
	@echo # MMS_CFG_VER - Indicates the last version in which the MMS cfg changed >>  $(ENVFILE)
	@echo # DGRU_CFG_VER - Indicates the last version in which the DGRU cfg changed >>  $(ENVFILE)
	@echo # DGIM_CFG_VER - Indicates the last version in which the DGIM cfg changed >>  $(ENVFILE)
	@echo # OSLIBDIR- specifies the path to the root OS library directory               >>  $(ENVFILE)
	@echo # - this directory must have a osInfo.txt file                                >>  $(ENVFILE)
	@echo # SSLIBDIR- same as OSLIBDIR except for the SS library                        >>  $(ENVFILE)
	@echo # FSLIBDIR- same as OSLIBDIR except for the file system library               >>  $(ENVFILE)
	@echo # CMLIBDIR- same as OSLIBDIR except for the common library                    >>  $(ENVFILE)
	@echo #**************************************************************************** >>  $(ENVFILE)
	@echo VERSION = $(VERSION)>>  $(ENVFILE)
	@echo D8PSK_VENDOR = $(D8PSK_VENDOR)>>  $(ENVFILE)
	@echo GPS_VENDOR = $(GPS_VENDOR)>>  $(ENVFILE)
	@echo TEST_CFG_VER = $(TEST_CFG_VER)>>  $(ENVFILE)
	@echo MMS_CFG_VER = $(MMS_CFG_VER)>>  $(ENVFILE)
	@echo DGRU_CFG_VER = $(DGRU_CFG_VER)>>  $(ENVFILE)
	@echo DGIM_CFG_VER = $(DGIM_CFG_VER)>>  $(ENVFILE)
	@echo OSLIBDIR = $(OSLIBDIR)>>  $(ENVFILE)
	@echo SSLIBDIR = $(SSLIBDIR)>>  $(ENVFILE)
	@echo FSLIBDIR = $(FSLIBDIR)>>  $(ENVFILE)
	@echo CMLIBDIR = $(CMLIBDIR)>>  $(ENVFILE)
