Permalink
Browse files

Add code generation scripts. (make export)

Add GL, GLX, WGL, CGL, EGL API databases for code generation purposes.
Reduce the order dependence of code generation.
Android build refinements.
  • Loading branch information...
1 parent f365c3b commit 30b994ac14c6e6af9ec76e9cefd0702c6a34de73 @nigels-com nigels-com committed Aug 2, 2012
Showing with 137,277 additions and 88,102 deletions.
  1. +61 −14 build/android/Regal/Android.mk
  2. +24 −0 build/android/Regal/Androidold.mk
  3. +4 −0 build/android/Regal/Application.mk
  4. +17 −0 build/ios/Regal/Regal.xcodeproj/project.pbxproj
  5. +16 −0 build/mac/Regal/Regal.xcodeproj/project.pbxproj
  6. +6 −5 examples/dreamtorus/android/jni/Android.mk
  7. +38 −126 examples/dreamtorus/ios/minimal_ios.xcodeproj/project.pbxproj
  8. +35 −123 examples/dreamtorus/osx/minimal_osx.xcodeproj/project.pbxproj
  9. +77 −113 include/GL/Regal.h
  10. +152 −0 scripts/Api.py
  11. +129 −0 scripts/ApiCg.py
  12. +141 −0 scripts/ApiCodeFilter.py
  13. +607 −0 scripts/ApiCodeGen.py
  14. +136 −0 scripts/ApiGLEW.py
  15. +1,215 −0 scripts/ApiTrace.py
  16. +247 −0 scripts/ApiType.py
  17. +154 −0 scripts/ApiUtil.py
  18. +13 −0 scripts/DispatchDebug.py
  19. +127 −0 scripts/Emu.py
  20. +8 −0 scripts/EmuBin.py
  21. +395 −0 scripts/EmuDsa.py
  22. +11 −0 scripts/EmuErrorString.py
  23. +18 −0 scripts/EmuExtensionQuery.py
  24. +19 −0 scripts/EmuForceCore.py
  25. +17 −0 scripts/EmuGetString.py
  26. +224 −0 scripts/EmuIff.py
  27. +51 −0 scripts/EmuLog.py
  28. +33 −0 scripts/EmuLookup.py
  29. +22 −0 scripts/EmuMarker.py
  30. +16 −0 scripts/EmuObj.py
  31. +28 −0 scripts/EmuPpa.py
  32. +150 −0 scripts/EmuPpc.py
  33. +85 −0 scripts/EmuVao.py
  34. +2,946 −0 scripts/Export.py
  35. +951 −0 scripts/cgl.py
  36. +685 −0 scripts/egl.py
  37. +36,436 −0 scripts/gl.py
  38. +2,190 −0 scripts/glx.py
  39. +2,230 −0 scripts/wgl.py
  40. +15,149 −15,176 src/regal/Regal.cpp
  41. +2,520 −2,539 src/regal/RegalDispatch.h
  42. +7,521 −7,546 src/regal/RegalDispatchDebug.cpp
  43. +5,574 −5,584 src/regal/RegalDispatchEmu.cpp
  44. +12,473 −12,498 src/regal/RegalDispatchError.cpp
  45. +30,952 −30,977 src/regal/RegalDispatchLoader.cpp
  46. +9,926 −9,951 src/regal/RegalDispatchLog.cpp
  47. +3,436 −3,436 src/regal/RegalEnum.h
  48. +3 −6 src/regal/RegalLookup.cpp
  49. +5 −5 src/regal/RegalLookup.h
  50. +1 −0 src/regal/RegalMac.cpp
  51. +3 −3 src/regal/RegalToken.cpp
@@ -1,23 +1,70 @@
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
+# Regal should be shipped with prebult binaries, however, if people tinker, etc...
+#
-LOCAL_MODULE := Regal
-LOCAL_CFLAGS := -Werror
-LOCAL_ARM_MODE := arm
+REGAL_FORCE_REBUILD := $(strip $(REGAL_FORCE_REBUILD))
+ifndef REGAL_FORCE_REBUILD
+ ifeq (,$(strip $(wildcard $(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/libRegal_static.a)))
+ $(call __ndk_info,WARNING: Rebuilding Regal libraries from sources!)
+ $(call __ndk_info,You might want to use build/android/build-regal.sh)
+ $(call __ndk_info,in order to build prebuilt versions for $(TARGET_ARCH_ABI) to speed up your builds!)
+ REGAL_FORCE_REBUILD := true
+ endif
+endif
+
+regal_cflags := -DANDROID=1 -Werror
+
+regal_path := $(LOCAL_PATH)/../../..
+
+# src_files should not include LOCAL_PATH
+regal_src_files := $(wildcard $(regal_path)/src/regal/*.cpp) $(regal_path)/src/mongoose/mongoose.c
+regal_src_files := $(patsubst $(LOCAL_PATH)/%,%,$(regal_src_files))
-REGAL_DIR := ../../..
-REGAL_SRC := $(REGAL_DIR)/src
+regal_c_includes := $(regal_path)/include $(regal_path)/src/regal $(regal_path)/src/boost $(regal_path)/src/mongoose
-REGAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/$(REGAL_SRC)/regal/*.cpp) $(LOCAL_PATH)/$(REGAL_SRC)/mongoose/mongoose.c
-REGAL_C_INCLUDES := $(REGAL_DIR)/include $(REGAL_SRC)/regal $(REGAL_SRC)/boost $(REGAL_SRC)/mongoose
+regal_export_c_includes := $(regal_path)/include
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(REGAL_DIR)/include
-LOCAL_C_INCLUDES := $(patsubst %,$(LOCAL_PATH)/%, $(REGAL_C_INCLUDES))
-LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(REGAL_SRC_FILES))
-LOCAL_CFLAGS := -DANDROID=1
+ifneq ($(REGAL_FORCE_REBUILD),true)
-$(warning local-path= $(LOCAL_PATH) src= $(LOCAL_SRC_FILES))
+$(call ndk_log,Using prebuilt Regal libraries)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := Regal_static
+LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
+LOCAL_EXPORT_C_INCLUDES := $(regal_export_c_includes)
+include $(PREBUILT_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := Regal_shared
+LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so
+LOCAL_EXPORT_C_INCLUDES := $(regal_export_c_includes)
+include $(PREBUILT_SHARED_LIBRARY)
+else # REGAL_FORCE_REBUILD == true
+
+$(call ndk_log,Rebuilding Regal libraries from sources)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := Regal_static
+LOCAL_SRC_FILES := $(regal_src_files)
+LOCAL_CFLAGS := $(regal_cflags)
+LOCAL_C_INCLUDES := $(regal_c_includes)
+LOCAL_EXPORT_C_INCLUDES := $(regal_export_c_includes)
+LOCAL_EXPORT_LDLIBS := -llog
+LOCAL_ARM_MODE := arm
include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := Regal_shared
+LOCAL_SRC_FILES := $(regal_src_files)
+LOCAL_CFLAGS := $(regal_cflags)
+LOCAL_C_INCLUDES := $(regal_c_includes)
+LOCAL_EXPORT_C_INCLUDES := $(regal_export_c_includes)
+LOCAL_LDLIBS := -llog
+LOCAL_EXPORT_LDLIBS := -llog
+LOCAL_ARM_MODE := arm
+include $(BUILD_SHARED_LIBRARY)
+
+endif # REGAL_FORCE_REBUILD == true
@@ -0,0 +1,24 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := Regal
+LOCAL_ARM_MODE := arm
+LOCAL_CFLAGS := -DANDROID=1 -Werror
+
+REGAL_PATH := $(LOCAL_PATH)/../../..
+
+# src_files should not include LOCAL_PATH
+REGAL_SRC_FILES := $(wildcard $(REGAL_PATH)/src/regal/*.cpp) $(REGAL_PATH)/src/mongoose/mongoose.c
+REGAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(REGAL_SRC_FILES))
+
+REGAL_C_INCLUDES := $(REGAL_PATH)/include $(REGAL_PATH)/src/regal $(REGAL_PATH)/src/boost $(REGAL_PATH)/src/mongoose
+
+LOCAL_EXPORT_C_INCLUDES := $(REGAL_PATH)/include
+
+LOCAL_C_INCLUDES := $(REGAL_C_INCLUDES)
+LOCAL_SRC_FILES := $(REGAL_SRC_FILES)
+
+#$(warning local-path= $(LOCAL_PATH) src= $(LOCAL_SRC_FILES))
+
+include $(BUILD_STATIC_LIBRARY)
@@ -0,0 +1,4 @@
+
+APP_MODULES := Regal_static Regal_shared
+APP_STL := stlport_static
+
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ 4366EEEE15C9B54E00211205 /* RegalEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 4366EEEA15C9B54E00211205 /* RegalEnum.h */; };
+ 4366EEEF15C9B54E00211205 /* RegalFavicon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4366EEEB15C9B54E00211205 /* RegalFavicon.cpp */; };
+ 4366EEF015C9B54E00211205 /* RegalFavicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 4366EEEC15C9B54E00211205 /* RegalFavicon.h */; };
+ 4366EEF115C9B54E00211205 /* RegalMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4366EEED15C9B54E00211205 /* RegalMac.cpp */; };
43FC5EDF15C45EBB00D0177C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43FC5EDE15C45EBB00D0177C /* Foundation.framework */; };
43FC5F7815C4619B00D0177C /* linear.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FC5F4B15C4619B00D0177C /* linear.h */; };
43FC5F7915C4619B00D0177C /* Regal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43FC5F4C15C4619B00D0177C /* Regal.cpp */; };
@@ -57,6 +61,10 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 4366EEEA15C9B54E00211205 /* RegalEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalEnum.h; path = ../../../src/regal/RegalEnum.h; sourceTree = "<group>"; };
+ 4366EEEB15C9B54E00211205 /* RegalFavicon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFavicon.cpp; path = ../../../src/regal/RegalFavicon.cpp; sourceTree = "<group>"; };
+ 4366EEEC15C9B54E00211205 /* RegalFavicon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFavicon.h; path = ../../../src/regal/RegalFavicon.h; sourceTree = "<group>"; };
+ 4366EEED15C9B54E00211205 /* RegalMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalMac.cpp; path = ../../../src/regal/RegalMac.cpp; sourceTree = "<group>"; };
43FC5EDB15C45EBB00D0177C /* libRegal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRegal.a; sourceTree = BUILT_PRODUCTS_DIR; };
43FC5EDE15C45EBB00D0177C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
43FC5F4B15C4619B00D0177C /* linear.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linear.h; path = ../../../src/regal/linear.h; sourceTree = "<group>"; };
@@ -147,6 +155,10 @@
43FC5F4A15C4617A00D0177C /* Regal */ = {
isa = PBXGroup;
children = (
+ 4366EEEA15C9B54E00211205 /* RegalEnum.h */,
+ 4366EEEB15C9B54E00211205 /* RegalFavicon.cpp */,
+ 4366EEEC15C9B54E00211205 /* RegalFavicon.h */,
+ 4366EEED15C9B54E00211205 /* RegalMac.cpp */,
43FC5FA515C461A100D0177C /* mongoose */,
43FC5F4B15C4619B00D0177C /* linear.h */,
43FC5F4C15C4619B00D0177C /* Regal.cpp */,
@@ -239,6 +251,8 @@
43FC5FA115C4619B00D0177C /* RegalToken.h in Headers */,
43FC5FA315C4619B00D0177C /* RegalUtil.h in Headers */,
43FC5FA415C4619B00D0177C /* RegalVao.h in Headers */,
+ 4366EEEE15C9B54E00211205 /* RegalEnum.h in Headers */,
+ 4366EEF015C9B54E00211205 /* RegalFavicon.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -312,6 +326,8 @@
43FC5FA015C4619B00D0177C /* RegalToken.cpp in Sources */,
43FC5FA215C4619B00D0177C /* RegalUtil.cpp in Sources */,
43FC5FA715C461AC00D0177C /* mongoose.c in Sources */,
+ 4366EEEF15C9B54E00211205 /* RegalFavicon.cpp in Sources */,
+ 4366EEF115C9B54E00211205 /* RegalMac.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -415,6 +431,7 @@
43FC5EEA15C45EBB00D0177C /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ 431D3C0D15C9B6F0009DD04F /* RegalEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 431D3C0915C9B6F0009DD04F /* RegalEnum.h */; };
+ 431D3C0E15C9B6F0009DD04F /* RegalFavicon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */; };
+ 431D3C0F15C9B6F0009DD04F /* RegalFavicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */; };
+ 431D3C1015C9B6F0009DD04F /* RegalMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */; };
43A6C1FF15C48D200063667E /* linear.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1D215C48D1F0063667E /* linear.h */; };
43A6C20015C48D200063667E /* Regal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A6C1D315C48D1F0063667E /* Regal.cpp */; };
43A6C20115C48D200063667E /* RegalBin.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A6C1D415C48D1F0063667E /* RegalBin.h */; };
@@ -56,6 +60,10 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 431D3C0915C9B6F0009DD04F /* RegalEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalEnum.h; path = ../../../src/regal/RegalEnum.h; sourceTree = "<group>"; };
+ 431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFavicon.cpp; path = ../../../src/regal/RegalFavicon.cpp; sourceTree = "<group>"; };
+ 431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFavicon.h; path = ../../../src/regal/RegalFavicon.h; sourceTree = "<group>"; };
+ 431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalMac.cpp; path = ../../../src/regal/RegalMac.cpp; sourceTree = "<group>"; };
43A6C1C615C48CD90063667E /* libRegal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRegal.a; sourceTree = BUILT_PRODUCTS_DIR; };
43A6C1D215C48D1F0063667E /* linear.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linear.h; path = ../../../src/regal/linear.h; sourceTree = "<group>"; };
43A6C1D315C48D1F0063667E /* Regal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Regal.cpp; path = ../../../src/regal/Regal.cpp; sourceTree = "<group>"; };
@@ -135,6 +143,10 @@
43A6C1D015C48CFA0063667E /* Regal */ = {
isa = PBXGroup;
children = (
+ 431D3C0915C9B6F0009DD04F /* RegalEnum.h */,
+ 431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */,
+ 431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */,
+ 431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */,
43A6C22C15C48D2D0063667E /* mongoose */,
43A6C1D215C48D1F0063667E /* linear.h */,
43A6C1D315C48D1F0063667E /* Regal.cpp */,
@@ -227,6 +239,8 @@
43A6C22815C48D200063667E /* RegalToken.h in Headers */,
43A6C22A15C48D200063667E /* RegalUtil.h in Headers */,
43A6C22B15C48D200063667E /* RegalVao.h in Headers */,
+ 431D3C0D15C9B6F0009DD04F /* RegalEnum.h in Headers */,
+ 431D3C0F15C9B6F0009DD04F /* RegalFavicon.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -300,6 +314,8 @@
43A6C22715C48D200063667E /* RegalToken.cpp in Sources */,
43A6C22915C48D200063667E /* RegalUtil.cpp in Sources */,
43A6C22E15C48D3A0063667E /* mongoose.c in Sources */,
+ 431D3C0E15C9B6F0009DD04F /* RegalFavicon.cpp in Sources */,
+ 431D3C1015C9B6F0009DD04F /* RegalMac.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -21,18 +21,19 @@ LOCAL_MODULE := libminimalAndroid
LOCAL_CFLAGS := -Werror
LOCAL_ARM_MODE := arm
-SHARED_DIR := ../../src
+SHARED_DIR := $(LOCAL_PATH)/../../src
-LOCAL_C_INCLUDES += $(patsubst %, $(LOCAL_PATH)/%, $(SHARED_DIR) )
-LOCAL_SRC_FILES := gl_code.cpp $(SHARED_DIR)/render.cpp
-LOCAL_STATIC_LIBRARIES += Regal
+LOCAL_C_INCLUDES += $(SHARED_DIR)
+MY_SRC_FILES := gl_code.cpp $(SHARED_DIR)/render.cpp
+LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(MY_SRC_FILES))
+LOCAL_STATIC_LIBRARIES += Regal_static
LOCAL_CFLAGS := -DANDROID=1
LOCAL_LDLIBS := -llog
#-lGLESv2
include $(BUILD_SHARED_LIBRARY)
-$(call import-add-path, ../../../../build/android)
+$(call import-add-path, $(LOCAL_PATH)/../../../../build/android)
$(call import-module, Regal)
Oops, something went wrong.

0 comments on commit 30b994a

Please sign in to comment.