From 1032834fbc3a0d274d0b84f54028ab98860579a2 Mon Sep 17 00:00:00 2001 From: borutr Date: Wed, 28 Aug 2002 11:45:20 +0000 Subject: [PATCH] added - genarate sdcc_vc.h using sdcc_vc_in.h as template and insert the version number definitions from .version git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2082 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- config.dsp | 88 ++++++++++++++++++++++++++++++++++++++++++++++++ configure_vc.awk | 60 +++++++++++++++++++++++++++++++++ sdcc_vc_in.h | 48 ++++++++++++++++++++++++++ 3 files changed, 196 insertions(+) create mode 100644 config.dsp create mode 100644 configure_vc.awk create mode 100644 sdcc_vc_in.h diff --git a/config.dsp b/config.dsp new file mode 100644 index 00000000..3a3fc230 --- /dev/null +++ b/config.dsp @@ -0,0 +1,88 @@ +# Microsoft Developer Studio Project File - Name="config" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=config - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "config.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "config.mak" CFG="config - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "config - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "config - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "config - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "config - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "config - Win32 Release" +# Name "config - Win32 Debug" +# Begin Source File + +SOURCE=.\sdcc_vc_in.h + +!IF "$(CFG)" == "config - Win32 Release" + +# Begin Custom Build +InputPath=.\sdcc_vc_in.h + +"sdcc_vc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + gawk -f configure_vc.awk sdcc_vc_in.h > sdcc_vc.h +# End Custom Build + +!ELSEIF "$(CFG)" == "config - Win32 Debug" + +# Begin Custom Build +InputPath=.\sdcc_vc_in.h + +"sdcc_vc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + gawk -f configure_vc.awk sdcc_vc_in.h > sdcc_vc.h +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/configure_vc.awk b/configure_vc.awk new file mode 100644 index 00000000..b44c9685 --- /dev/null +++ b/configure_vc.awk @@ -0,0 +1,60 @@ +#!/usr/bin/awk + +# configure_vc.awk - Genarate sdcc_vc.h using sdcc_vc_in.h as template +# and insert the version number definitions from .version +# +# Written By - Borut Razem borut.razem@siol.net +# +# This file is part of sdcc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +BEGIN { + FS="."; + getline <".version"; + h = $1; + l = $2; + p = $3; + print "/*" + print " * sdcc_vc.h" + print " * Generated automatically by configure_vc.awk, DO NOT edit!" + print " * To make changes to sdcc_vc.h edit sdcc_vc_in.h instead." + print " */" + print "" +} + +/^#undef SDCC_VERSION_HI$/ { + print("#define SDCC_VERSION_HI " h); + next +} + +/^#undef SDCC_VERSION_LO$/ { + print("#define SDCC_VERSION_LO " l); + next +} + +/^#undef SDCC_VERSION_P$/ { + print("#define SDCC_VERSION_P " p); + next +} + +/^#undef SDCC_VERSION_STR$/ { + print("#define SDCC_VERSION_STR " "\"" h "." l "." p "\""); + next +} + +{ + print +} diff --git a/sdcc_vc_in.h b/sdcc_vc_in.h new file mode 100644 index 00000000..bcd19cd6 --- /dev/null +++ b/sdcc_vc_in.h @@ -0,0 +1,48 @@ +#ifndef SDCC_VC_HEADER +#define SDCC_VC_HEADER + + +#undef SDCC_VERSION_HI +#undef SDCC_VERSION_LO +#undef SDCC_VERSION_P +#undef SDCC_VERSION_STR + +/* MSVC 6 does not have __FUNCTION__ preprocessor macro defined */ + +#if defined(_MSC_VER) && (_MSC_VER < 1300) +#define __FUNCTION__ __FILE__ +#endif + +#undef PREFIX +#undef DATADIR +#undef SRCDIR + +#define PREFIX "\\sdcc" + +//#define STANDARD_INCLUDE_DIR "\\sdcc\\local\\share\\include" +#define SDCC_INCLUDE_DIR "\\sdcc\\include" +#define SDCC_LIB_DIR "\\sdcc\\lib" + +#define STD_LIB "libsdcc" +#define STD_INT_LIB "libint" +#define STD_LONG_LIB "liblong" +#define STD_FP_LIB "libfloat" +#define STD_DS390_LIB "libds390" + +// #undef HAVE_SYS_SOCKET_H +// #undef HAVE_SYS_ISA_DEFS_H +// #undef HAVE_ENDIAN_H + +#undef HAVE_STRERROR + +#undef OPT_DISABLE_MCS51 +#undef OPT_DISABLE_GBZ80 +#undef OPT_DISABLE_Z80 +#undef OPT_DISABLE_AVR +#undef OPT_DISABLE_TININative +#undef OPT_DISABLE_PIC +#undef OPT_DISABLE_XA51 + +#endif /* SDCC_VC_HEADER */ + +/* End of sdcc_vc.h */ -- 2.30.2