Browse Source

Compiling the documentation generator without any build system to make it more accessible.

David Piuva 3 years ago
parent
commit
c59defafdb
2 changed files with 11 additions and 22 deletions
  1. 3 18
      Doc/Generator/build.sh
  2. 8 4
      Doc/Generator/main.cpp

+ 3 - 18
Doc/Generator/build.sh

@@ -1,24 +1,9 @@
 #!/bin/bash
 
-# Assuming that you called build.sh from its own folder, you should already be in the project folder.
-PROJECT_FOLDER=.
-# Placing your executable in the project folder allow using the same relative paths in the final release.
-TARGET_FILE=./generator
-# The root folder is where DFPSR, SDK and tools are located.
-ROOT_PATH=../../Source
-# Select where to place temporary files and the generated executable
-TEMP_DIR=${ROOT_PATH}/../../temporary
-# Select a window manager
-WINDOW_MANAGER=NONE
-# Flags for the compiler
-COMPILER_FLAGS="-std=c++14 -O2"
-# Select external libraries
-LINKER_FLAGS=""
+LIBRARY_PATH=../../Source/DFPSR
+DEPENDENCIES="${LIBRARY_PATH}/collection/collections.cpp ${LIBRARY_PATH}/api/fileAPI.cpp ${LIBRARY_PATH}/api/bufferAPI.cpp ${LIBRARY_PATH}/api/stringAPI.cpp ${LIBRARY_PATH}/base/SafePointer.cpp"
 
-# Give execution permission
-chmod +x ${ROOT_PATH}/tools/build.sh;
-# Compile everything
-${ROOT_PATH}/tools/build.sh "${PROJECT_FOLDER}" "${TARGET_FILE}" "${ROOT_PATH}" "${TEMP_DIR}" "${WINDOW_MANAGER}" "${COMPILER_FLAGS}" "${LINKER_FLAGS}";
+g++ main.cpp -o generator ${DEPENDENCIES} -std=c++14 -lm
 
 # Execute the generation script to see the changes
 chmod +x gen.sh

+ 8 - 4
Doc/Generator/main.cpp

@@ -5,13 +5,17 @@
   Follow include "", but not include <> when listing types.
 */
 
-#include "../../Source/DFPSR/includeFramework.h"
+// Only fileAPI.h is needed to also get stringAPI, bufferAPI, SafePointer.h and List.h.
+// Needs to compile and link with:
+//   DFPSR/collection/collections.cpp
+//   DFPSR/api/fileAPI.cpp
+//   DFPSR/api/bufferAPI.cpp
+//   DFPSR/api/stringAPI.cpp
+//   DFPSR/base/SafePointer.cpp
+#include "../../Source/DFPSR/api/fileAPI.h"
 
 using namespace dsr;
 
-// This program is only for maintaining the library's documentation,
-//   so it's okay to use features specific to the Linux operating system.
-
 String resourceFolderPath;
 
 bool string_beginsWith(const ReadableString &a, const ReadableString &b) {