Skip to content

Commit

Permalink
Change the path of headers to /usr/local/include/chaos
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed Apr 21, 2020
1 parent 0da1e22 commit f66bd2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions Chaos.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@

#include <stdbool.h>

#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);
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f66bd2c

Please sign in to comment.