From f66bd2ceda6a836bfd061a390e138722360b3f0f Mon Sep 17 00:00:00 2001 From: Mehmet Mert Yildiran Date: Tue, 21 Apr 2020 03:00:03 +0300 Subject: [PATCH] Change the path of headers to /usr/local/include/chaos --- Chaos.h | 5 +++++ Makefile | 20 ++++++++++---------- make.bat | 18 +++++++++--------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Chaos.h b/Chaos.h index 83732fc5..35a1a8fe 100644 --- a/Chaos.h +++ b/Chaos.h @@ -3,8 +3,13 @@ #include +#if defined(CHAOS_INTERPRETER) #include "enums.h" #include "utilities/language.h" +#else +#include "chaos/enums.h" +#include "chaos/language.h" +#endif int defineFunction(char *name, enum Type type, char *params_name[], unsigned params_type[], unsigned short params_length); bool getVariableBool(char *name); diff --git a/Makefile b/Makefile index c2b0240d..4d832c13 100644 --- a/Makefile +++ b/Makefile @@ -12,19 +12,19 @@ requirements: ./requirements.sh requirements-dev: - mkdir -p /usr/local/include/utilities - cp utilities/language.h /usr/local/include/utilities/ - cp utilities/platform.h /usr/local/include/utilities/ - cp enums.h /usr/local/include/ + mkdir -p /usr/local/include/chaos + cp utilities/language.h /usr/local/include/chaos/ + cp utilities/platform.h /usr/local/include/chaos/ + cp enums.h /usr/local/include/chaos/ cp Chaos.h /usr/local/include/ ifeq ($(UNAME_S), Darwin) $(eval GCC_VERSION=$(shell gcc -dumpversion)) $(eval GCC_MAJOR_VERSION=$(shell gcc -dumpversion | cut -d. -f1)) - mkdir -p /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/utilities - cp utilities/language.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/utilities - cp utilities/platform.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/utilities - cp enums.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include - cp Chaos.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include + mkdir -p /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/chaos + cp utilities/language.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/chaos/ + cp utilities/platform.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/chaos/ + cp enums.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/chaos/ + cp Chaos.h /usr/local/Cellar/gcc@$(GCC_MAJOR_VERSION)/$(GCC_VERSION)/lib/gcc/$(GCC_MAJOR_VERSION)/gcc/x86_64-apple-darwin19/$(GCC_VERSION)/include/ endif clang: @@ -63,7 +63,7 @@ lex.yy.c: chaos.l chaos.tab.h flex chaos.l chaos: lex.yy.c chaos.tab.c chaos.tab.h - ${CHAOS_COMPILER} -Werror -Iloops -Ifunctions -Imodules -o chaos chaos.tab.c lex.yy.c loops/*.c functions/*.c modules/*.c utilities/*.c symbol.c errors.c Chaos.c -lreadline -L/usr/local/opt/readline/lib -I/usr/local/opt/readline/include -ldl ${CHAOS_EXTRA_FLAGS} + ${CHAOS_COMPILER} -Werror -Iloops -Ifunctions -Imodules -DCHAOS_INTERPRETER -o chaos chaos.tab.c lex.yy.c loops/*.c functions/*.c modules/*.c utilities/*.c symbol.c errors.c Chaos.c -lreadline -L/usr/local/opt/readline/lib -I/usr/local/opt/readline/include -ldl ${CHAOS_EXTRA_FLAGS} clean: rm -rf chaos chaos.tab.c lex.yy.c chaos.tab.h diff --git a/make.bat b/make.bat index b96bb649..53067961 100644 --- a/make.bat +++ b/make.bat @@ -87,7 +87,7 @@ win_bison -d chaos.y IF errorlevel 1 ( EXIT /B 1 ) -%compiler% -Iloops -Ifunctions -Imodules -o chaos.exe chaos.tab.c lex.yy.c loops/*.c functions/*.c modules/*.c utilities/*.c symbol.c errors.c Chaos.c %extra_flags% +%compiler% -Iloops -Ifunctions -Imodules -DCHAOS_INTERPRETER -o chaos.exe chaos.tab.c lex.yy.c loops/*.c functions/*.c modules/*.c utilities/*.c symbol.c errors.c Chaos.c %extra_flags% IF errorlevel 1 ( EXIT /B 1 ) @@ -121,20 +121,20 @@ SET /p CLANG_VERSION= < tmpFile DEL tmpFile ECHO "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\" -IF not exist "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\utilities" mkdir "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\utilities" -COPY utilities\language.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\utilities\" -COPY utilities\platform.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\utilities\" -COPY enums.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\" +IF not exist "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\chaos" mkdir "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\chaos" +COPY utilities\language.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\chaos\" +COPY utilities\platform.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\chaos\" +COPY enums.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\chaos\" COPY Chaos.h "%programdata%\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\!GCC_VERSION!\include\" IF errorlevel 1 ( EXIT /B 1 ) ECHO "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\" -IF not exist "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\utilities" mkdir "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\utilities" -COPY utilities\language.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\utilities\"" -COPY utilities\platform.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\utilities\" -COPY enums.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\" +IF not exist "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\chaos" mkdir "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\chaos" +COPY utilities\language.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\chaos\" +COPY utilities\platform.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\chaos\" +COPY enums.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\chaos\" COPY Chaos.h "%programfiles%\LLVM\lib\clang\!CLANG_VERSION!\include\" IF errorlevel 1 ( EXIT /B 1