mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
define prebuild-bison
This commit is contained in:
parent
33c55ca32c
commit
621ad03421
@ -278,7 +278,7 @@
|
||||
// How about GLX?
|
||||
#define GLX_IPATH
|
||||
#define GLX_LPATH
|
||||
#defer HAVE_WGL $[and $[HAVE_GL],$[UNIX_PLATFORM]]
|
||||
#defer HAVE_GLX $[and $[HAVE_GL],$[UNIX_PLATFORM]]
|
||||
|
||||
// Glut?
|
||||
#define GLUT_IPATH
|
||||
@ -295,12 +295,10 @@
|
||||
#define HAVE_SGIGL $[eq $[PLATFORM],Irix]
|
||||
|
||||
// Is DirectX available, and should we try to build with it?
|
||||
#if $[WINDOWS_PLATFORM]
|
||||
#define DX_IPATH
|
||||
#define DX_LPATH
|
||||
#define DX_LIBS d3d8.lib d3dx8.lib dxerr8.lib
|
||||
#defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]]
|
||||
#endif
|
||||
#define DX_IPATH
|
||||
#define DX_LPATH
|
||||
#define DX_LIBS d3d8.lib d3dx8.lib dxerr8.lib
|
||||
#defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]]
|
||||
|
||||
// Do you want to build the Renderman interface?
|
||||
#define HAVE_RIB
|
||||
@ -421,10 +419,6 @@
|
||||
#define USE_COMPILER GCC
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// The following variables are meaningful when BUILD_TYPE is "unix" or
|
||||
// "msvc". They define a few environmental things.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// How to invoke bison and flex. Panda takes advantage of some
|
||||
// bison/flex features, and therefore specifically requires bison and
|
||||
@ -436,6 +430,12 @@
|
||||
#defer BISON bison
|
||||
#defer FLEX flex
|
||||
|
||||
// You may not even have bison and flex installed. If you don't, no
|
||||
// sweat; Panda ships with the pre-generated output of these programs,
|
||||
// so you don't need them unless you want to make changes to the
|
||||
// grammars themselves (files named *.yxx or *.lxx).
|
||||
#defer HAVE_BISON $[bintest $[BISON]]
|
||||
|
||||
// How to invoke sed. A handful of make rules use this. Since some
|
||||
// platforms (specifically, non-Unix platforms like Windows) don't
|
||||
// have any kind of sed, ppremake performs some limited sed-like
|
||||
|
@ -135,6 +135,9 @@ $[cdefine HAVE_AUDIO]
|
||||
makes sense to MSVC++. */
|
||||
$[cdefine EXPORT_TEMPLATES]
|
||||
|
||||
/* Define if we have bison and flex available. */
|
||||
$[cdefine HAVE_BISON]
|
||||
|
||||
/* Define if we are linking PANDAGL in with PANDA. */
|
||||
$[cdefine LINK_IN_GL]
|
||||
|
||||
|
@ -137,6 +137,9 @@
|
||||
// And $[libs] is the set of libraries we will link with.
|
||||
#defer libs $[unique $[complete_local_libs] $[patsubst %:m,,%:c %,%,$[OTHER_LIBS]] $[get_libs]]
|
||||
|
||||
// This is the set of files we might copy into *.prebuilt, if we have
|
||||
// bison and flex (or copy from *.prebuilt if we don't have them).
|
||||
#define bison_prebuilt $[patsubst %.yxx,%.h,$[yxx_so_sources] $[yxx_st_sources]] $[patsubst %.yxx,%.cxx,$[yxx_so_sources] $[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_so_sources] $[lxx_st_sources]]
|
||||
|
||||
// Okay, we're ready. Start outputting the Makefile now.
|
||||
#output Makefile
|
||||
@ -239,6 +242,9 @@ uninstall-igate :
|
||||
$[TAB]rm -f $[sort $[installed_igate_files]]
|
||||
#endif
|
||||
|
||||
#if $[HAVE_BISON]
|
||||
prebuild-bison : $[patsubst %,%.prebuilt,$[bison_prebuilt]]
|
||||
#endif
|
||||
|
||||
// We need a rule for each directory we might need to make. This
|
||||
// loops through the full set of directories and creates a rule to
|
||||
@ -584,17 +590,30 @@ $[TAB]$[LINK_BIN_C]
|
||||
// Rules to generate a C++ file from a Bison input file.
|
||||
#foreach file $[sort $[yxx_so_sources] $[yxx_st_sources]]
|
||||
#define target $[patsubst %.yxx,%.cxx,$[file]]
|
||||
#define target_header $[patsubst %.yxx,%.h,$[file]]
|
||||
#if $[HAVE_BISON]
|
||||
#define source $[file]
|
||||
$[target] : $[source]
|
||||
$[TAB]$[BISON] -y $[YFLAGS] $[if $[YACC_PREFIX],-d --name-prefix=$[YACC_PREFIX]] $[source]
|
||||
$[TAB]mv y.tab.c $[target]
|
||||
$[TAB]mv y.tab.h $[patsubst %.yxx,%.h,$[source]]
|
||||
|
||||
$[TAB]mv y.tab.h $[target_header]
|
||||
$[target].prebuilt : $[target]
|
||||
$[TAB]cp $[target] $[target].prebuilt
|
||||
$[target_header].prebuilt : $[target_header]
|
||||
$[TAB]cp $[target_header] $[target_header].prebuilt
|
||||
#else // HAVE_BISON
|
||||
#define source $[target].prebuilt
|
||||
$[target] : $[source]
|
||||
$[TAB]cp $[source] $[target]
|
||||
$[target_header] : $[source]
|
||||
$[TAB]cp $[source] $[target_header]
|
||||
#endif // HAVE_BISON
|
||||
#end file
|
||||
|
||||
// Rules to generate a C++ file from a Flex input file.
|
||||
#foreach file $[sort $[lxx_so_sources] $[lxx_st_sources]]
|
||||
#define target $[patsubst %.lxx,%.cxx,$[file]]
|
||||
#if $[HAVE_BISON]
|
||||
#define source $[file]
|
||||
$[target] : $[source]
|
||||
$[TAB]$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
|
||||
@ -602,9 +621,16 @@ $[TAB]$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[sourc
|
||||
#define script /#include <unistd.h>/d
|
||||
$[TAB]$[SED]
|
||||
$[TAB]rm $[source]
|
||||
|
||||
$[target].prebuilt : $[target]
|
||||
$[TAB]cp $[target] $[target].prebuilt
|
||||
#else // HAVE_BISON
|
||||
#define source $[target].prebuilt
|
||||
$[target] : $[source]
|
||||
$[TAB]cp $[source] $[target]
|
||||
#endif // HAVE_BISON
|
||||
#end file
|
||||
|
||||
|
||||
// Rules to compile ordinary C files that appear on a shared library.
|
||||
#foreach file $[sort $[c_so_sources]]
|
||||
#define target $[patsubst %.c,$[so_dir]/%.o,$[file]]
|
||||
@ -788,6 +814,10 @@ $[TAB]rm -f $[install_headers_dir]/$[CONFIG_HEADER]
|
||||
#endif
|
||||
uninstall-igate : $[subdirs:%=uninstall-igate-%]
|
||||
|
||||
#if $[HAVE_BISON]
|
||||
prebuild-bison : $[subdirs:%=prebuild-bison-%]
|
||||
#endif
|
||||
|
||||
// Somehow, something in the cttools confuses some shells, so that
|
||||
// when we are attached, 'cd foo' doesn't work, but 'cd ./foo' does.
|
||||
// Weird. We get around this by putting a ./ in front of each cd
|
||||
@ -844,6 +874,13 @@ uninstall-igate-$[dirname] :
|
||||
$[TAB]cd ./$[PATH] && $(MAKE) uninstall-igate
|
||||
#end dirname
|
||||
|
||||
#if $[HAVE_BISON]
|
||||
#formap dirname subdirs
|
||||
prebuild-bison-$[dirname] :
|
||||
$[TAB]cd ./$[PATH] && $(MAKE) prebuild-bison
|
||||
#end dirname
|
||||
#endif
|
||||
|
||||
#if $[ne $[CONFIG_HEADER],]
|
||||
$[install_headers_dir] :
|
||||
$[TAB]@test -d $[install_headers_dir] || echo mkdir -p $[install_headers_dir]
|
||||
|
4854
dtool/src/cppparser/cppBison.cxx.prebuilt
Normal file
4854
dtool/src/cppparser/cppBison.cxx.prebuilt
Normal file
File diff suppressed because it is too large
Load Diff
115
dtool/src/cppparser/cppBison.h.prebuilt
Normal file
115
dtool/src/cppparser/cppBison.h.prebuilt
Normal file
@ -0,0 +1,115 @@
|
||||
|
||||
#ifndef YYLTYPE
|
||||
typedef
|
||||
struct yyltype
|
||||
{
|
||||
int timestamp;
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
char *text;
|
||||
}
|
||||
yyltype;
|
||||
|
||||
#define YYLTYPE yyltype
|
||||
#endif
|
||||
|
||||
#define REAL 257
|
||||
#define INTEGER 258
|
||||
#define CHAR 259
|
||||
#define STRING 260
|
||||
#define SIMPLE_IDENTIFIER 261
|
||||
#define IDENTIFIER 262
|
||||
#define TYPENAME_IDENTIFIER 263
|
||||
#define SCOPING 264
|
||||
#define TYPEDEFNAME 265
|
||||
#define ELLIPSIS 266
|
||||
#define OROR 267
|
||||
#define ANDAND 268
|
||||
#define EQCOMPARE 269
|
||||
#define NECOMPARE 270
|
||||
#define LECOMPARE 271
|
||||
#define GECOMPARE 272
|
||||
#define LSHIFT 273
|
||||
#define RSHIFT 274
|
||||
#define POINTSAT_STAR 275
|
||||
#define DOT_STAR 276
|
||||
#define UNARY 277
|
||||
#define UNARY_NOT 278
|
||||
#define UNARY_NEGATE 279
|
||||
#define UNARY_MINUS 280
|
||||
#define UNARY_STAR 281
|
||||
#define UNARY_REF 282
|
||||
#define POINTSAT 283
|
||||
#define SCOPE 284
|
||||
#define PLUSPLUS 285
|
||||
#define MINUSMINUS 286
|
||||
#define TIMESEQUAL 287
|
||||
#define DIVIDEEQUAL 288
|
||||
#define MODEQUAL 289
|
||||
#define PLUSEQUAL 290
|
||||
#define MINUSEQUAL 291
|
||||
#define OREQUAL 292
|
||||
#define ANDEQUAL 293
|
||||
#define XOREQUAL 294
|
||||
#define LSHIFTEQUAL 295
|
||||
#define RSHIFTEQUAL 296
|
||||
#define TOKENPASTE 297
|
||||
#define KW_BEGIN_PUBLISH 298
|
||||
#define KW_BOOL 299
|
||||
#define KW_CATCH 300
|
||||
#define KW_CHAR 301
|
||||
#define KW_CLASS 302
|
||||
#define KW_CONST 303
|
||||
#define KW_DELETE 304
|
||||
#define KW_DOUBLE 305
|
||||
#define KW_DYNAMIC_CAST 306
|
||||
#define KW_ELSE 307
|
||||
#define KW_END_PUBLISH 308
|
||||
#define KW_ENUM 309
|
||||
#define KW_EXTERN 310
|
||||
#define KW_EXPLICIT 311
|
||||
#define KW_PUBLISHED 312
|
||||
#define KW_FALSE 313
|
||||
#define KW_FLOAT 314
|
||||
#define KW_FRIEND 315
|
||||
#define KW_FOR 316
|
||||
#define KW_GOTO 317
|
||||
#define KW_IF 318
|
||||
#define KW_INLINE 319
|
||||
#define KW_INT 320
|
||||
#define KW_LONG 321
|
||||
#define KW_LONGLONG 322
|
||||
#define KW_MUTABLE 323
|
||||
#define KW_NAMESPACE 324
|
||||
#define KW_NEW 325
|
||||
#define KW_OPERATOR 326
|
||||
#define KW_PRIVATE 327
|
||||
#define KW_PROTECTED 328
|
||||
#define KW_PUBLIC 329
|
||||
#define KW_REGISTER 330
|
||||
#define KW_RETURN 331
|
||||
#define KW_SHORT 332
|
||||
#define KW_SIGNED 333
|
||||
#define KW_SIZEOF 334
|
||||
#define KW_STATIC 335
|
||||
#define KW_STATIC_CAST 336
|
||||
#define KW_STRUCT 337
|
||||
#define KW_TEMPLATE 338
|
||||
#define KW_THROW 339
|
||||
#define KW_TRUE 340
|
||||
#define KW_TRY 341
|
||||
#define KW_TYPEDEF 342
|
||||
#define KW_TYPENAME 343
|
||||
#define KW_UNION 344
|
||||
#define KW_UNSIGNED 345
|
||||
#define KW_USING 346
|
||||
#define KW_VIRTUAL 347
|
||||
#define KW_VOID 348
|
||||
#define KW_VOLATILE 349
|
||||
#define KW_WHILE 350
|
||||
#define START_CPP 351
|
||||
#define START_CONST_EXPR 352
|
||||
#define START_TYPE 353
|
||||
|
Loading…
x
Reference in New Issue
Block a user