diff --git a/Makefile b/Makefile index ed958b4..4993ac8 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,29 @@ INC := -I include -all: main exec +all: compile link -main: +compile: gcc $(INC) -c -o build/main.o src/main.c gcc $(INC) -c -o build/Integrated.o src/Integrated.c gcc $(INC) -c -o build/Pish.o src/Pish.c -exec: +link: gcc -o bin/pish.out build/*.o +exec: compile link + ./bin/pish.out + +debug: debugCompile debugLink + +debugCompile: + gcc $(INC) -g -c -o build/main.o src/main.c + gcc $(INC) -g -c -o build/Integrated.o src/Integrated.c + gcc $(INC) -g -c -o build/Pish.o src/Pish.c + +debugLink: + gcc -g -o bin/pish.out build/*.o + + clean: - rm build/* + rm build/*.o + rm bin/*.out diff --git a/include/Common.h b/include/Common.h new file mode 100755 index 0000000..7b217a3 --- /dev/null +++ b/include/Common.h @@ -0,0 +1,9 @@ +#ifndef COMMON_H +#define COMMON_H + +typedef struct CommandStruct { + char* argv[100]; // Max 100 commands + int argc; +} CommandStruct; + +#endif \ No newline at end of file diff --git a/include/Integrated.h b/include/Integrated.h index fe2509b..0826d06 100755 --- a/include/Integrated.h +++ b/include/Integrated.h @@ -1,6 +1,8 @@ #ifndef INTEGRATED_H #define INTEGRATED_H +#include "Common.h" + void IntegratedCheck(char* command); #endif \ No newline at end of file diff --git a/include/Pish.h b/include/Pish.h index fd60acd..1f230e4 100644 --- a/include/Pish.h +++ b/include/Pish.h @@ -1,8 +1,11 @@ #ifndef PISH_H #define PISH_H -char* getcmd(void); -void exec(char* command); +#include "Common.h" + void Pish(void); +void Execute(char* command); +void GetInput(char* inputString); +void ParseInput(char* inputString, CommandStruct* command); #endif