diff --git a/src/build.c b/src/build.c index 1c8fe94..4804262 100644 --- a/src/build.c +++ b/src/build.c @@ -50,6 +50,7 @@ char *create_new_makefile(char src_files[][1000]) { strcpy(makefile, "\ CC := gcc\n\ CFLAGS := -Wall -Werror\n\ +LIBS := -lvector -lfile -llist -lutil\n\ LIBSPATH := -L/usr/lib/odweta/\n\ INCLUDEDIR := -I/usr/include/odweta/\n\ PATCH := -Wl,-rpath=/usr/lib/odweta/\n\ diff --git a/src/new.c b/src/new.c index 640f2c8..91b5891 100644 --- a/src/new.c +++ b/src/new.c @@ -33,6 +33,7 @@ void makefile(char *name, char *path) { char *payload = "\ CC := gcc\n\ CFLAGS := -Wall -Werror\n\ +LIBS := -lvector -lfile -llist -lutil\n\ LIBSPATH := -L/usr/lib/odweta/\n\ INCLUDEDIR := -I/usr/include/odweta/\n\ PATCH := -Wl,-rpath=/usr/lib/odweta/\n\ diff --git a/src/run.c b/src/run.c index 97127aa..fe4f52e 100644 --- a/src/run.c +++ b/src/run.c @@ -1,31 +1,9 @@ #include "../include/run.h" #include "../include/build.h" -#include #include -int get_build_status() { - FILE *fd = fopen("./build/.build_status", "r"); - if (!fd) { - fprintf(stderr, "Build the project before running it.\n"); - exit(1); - } - - int i; - fscanf(fd, "%d", &i); - - fclose(fd); - - return i; // max 10 codes (so far only 2 => 0 -> success, 1 -> failure) -} - void run_project() { - if (get_build_status() == 0) { // success - // file exists => project has been built - system("make run"); - } else { - // file does not exist => project has not been built - build_project(); - run_project(); - } + build_project(); + system("make run"); }