From a1ce77a455ffb7ed92c23185718cffffccac0bce Mon Sep 17 00:00:00 2001 From: Netkas Date: Thu, 22 Sep 2022 16:41:54 -0400 Subject: [PATCH] Added Base files for Makefile and Php Utilities --- Makefile | 23 ++++++----- src/ncc/CLI/PhpMenu.php | 59 +++++++++++++++++++++++++++ src/ncc/CLI/ProjectMenu.php | 1 + src/ncc/Classes/MakefileGenerator.php | 25 ++++++++++++ src/templates/Makefile-php | 6 +++ 5 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 src/ncc/CLI/PhpMenu.php create mode 100644 src/ncc/Classes/MakefileGenerator.php create mode 100644 src/templates/Makefile-php diff --git a/Makefile b/Makefile index ca1c1ad..7c2e53c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +PHPCC=/usr/bin/php +$(PHPAB)=$(PHPAB) + autoload: # Generates/creates all the autoloader files make src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php @@ -11,35 +14,35 @@ autoload: cp src/autoload/autoload.php src/ncc/autoload.php src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php \ + $(PHPCC) $($(PHPAB)) --output src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php \ src/ncc/ThirdParty/defuse/php-encryption src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php \ src/ncc/ThirdParty/Symfony/polyfill-ctype src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php \ src/ncc/ThirdParty/Symfony/polyfill-mbstring src/ncc/ThirdParty/Symfony/Process/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/Symfony/Process/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/ThirdParty/Symfony/Process/autoload_spl.php \ src/ncc/ThirdParty/Symfony/Process src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php: - phpab --output src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php \ + $(PHPAB) --output src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php \ src/ncc/ThirdParty/Symfony/Uid src/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php \ src/ncc/ThirdParty/Symfony/Filesystem src/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php \ src/ncc/ThirdParty/Symfony/Yaml src/ncc/autoload_spl.php: - /usr/bin/env phpab --output src/ncc/autoload_spl.php \ + $(PHPCC) $(PHPAB) --output src/ncc/autoload_spl.php \ src/ncc/Abstracts \ src/ncc/Classes \ src/ncc/CLI \ @@ -62,8 +65,8 @@ redist: autoload chmod +x build/src/INSTALL cp LICENSE build/src/LICENSE cp README.md build/src/README.md - cp src/installer/hash_check.php build/src/hash_check.php; /usr/bin/env php build/src/hash_check.php; rm build/src/hash_check.php - cp src/installer/generate_build_files.php build/src/generate_build_files.php; /usr/bin/env php build/src/generate_build_files.php; rm build/src/generate_build_files.php + cp src/installer/hash_check.php build/src/hash_check.php; $(PHPCC) php build/src/hash_check.php; rm build/src/hash_check.php + cp src/installer/generate_build_files.php build/src/generate_build_files.php; $(PHPCC) php build/src/generate_build_files.php; rm build/src/generate_build_files.php tar: redist cd build/src; tar -czvf ../ncc.tar.gz * diff --git a/src/ncc/CLI/PhpMenu.php b/src/ncc/CLI/PhpMenu.php new file mode 100644 index 0000000..1c10f39 --- /dev/null +++ b/src/ncc/CLI/PhpMenu.php @@ -0,0 +1,59 @@ +toString($options_padding)); + } + } + } \ No newline at end of file diff --git a/src/ncc/CLI/ProjectMenu.php b/src/ncc/CLI/ProjectMenu.php index 2b1377b..8951128 100644 --- a/src/ncc/CLI/ProjectMenu.php +++ b/src/ncc/CLI/ProjectMenu.php @@ -112,6 +112,7 @@ $options = [ new CliHelpSection(['help'], 'Displays this help menu about the value command'), new CliHelpSection(['create', '--src', '--package', '--name'], 'Creates a new NCC project'), + new CliHelpSection(['create', '--makefile'], 'Generates a Makefile for the project'), ]; $options_padding = \ncc\Utilities\Functions::detectParametersPadding($options) + 4; diff --git a/src/ncc/Classes/MakefileGenerator.php b/src/ncc/Classes/MakefileGenerator.php new file mode 100644 index 0000000..009705a --- /dev/null +++ b/src/ncc/Classes/MakefileGenerator.php @@ -0,0 +1,25 @@ +project = $project; + } + + + + } \ No newline at end of file diff --git a/src/templates/Makefile-php b/src/templates/Makefile-php new file mode 100644 index 0000000..8cd33be --- /dev/null +++ b/src/templates/Makefile-php @@ -0,0 +1,6 @@ +PHPCC=%PHP_BIN_PATH% +NCC_SOURCE_PATH=%NCC_SOURCE_PATH% +NCC_BUILD_CONFIG=%NCC_BUILD_DEFAULT% + + +autoload: