diff --git a/minimake/Makefile b/minimake/Makefile index cb0ae0a..db29234 100644 --- a/minimake/Makefile +++ b/minimake/Makefile @@ -21,10 +21,10 @@ $(TARGET): $(OBJS) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) @echo $(OBJS) -# debug: CFLAGS += $(DBG_CFLAGS) -# debug: LDFLAGS += $(DBG_LDFLAGS) -# debug: $(OBJS) -# $(CC) -o $(TARGET) $^ $(LDFLAGS) $(LDLIBS) +debug: CFLAGS += $(DBG_CFLAGS) +debug: LDFLAGS += $(DBG_LDFLAGS) +debug: $(OBJS) + $(CC) -o $(TARGET) $^ $(LDFLAGS) $(LDLIBS) check: dash ./tests/run.sh diff --git a/minimake/src/files/files.c b/minimake/src/files/files.c index 2d46ecb..ef00e46 100644 --- a/minimake/src/files/files.c +++ b/minimake/src/files/files.c @@ -60,9 +60,6 @@ int run_command(char *command) fflush(stdout); fflush(stderr); - // char *executable; - // size_t args_offset = readword(command, strlen(command), &executable); - int id = fork(); if (id < 0) { @@ -72,14 +69,13 @@ int run_command(char *command) if (id == 0) { - int res = 0; - wait(&res); - // printf("Got return code: %d\n", res); - return res; + int res = execl("/bin/sh", "(make)", "-c", command, NULL); + exit(res); } else { - int res = execl("/bin/sh", "(make)", "-c", command, NULL); + int res = 0; + wait(&res); return res; } } diff --git a/minimake/tests/Makefile.test4 b/minimake/tests/Makefile.test4 index 45ee423..4da97dd 100644 --- a/minimake/tests/Makefile.test4 +++ b/minimake/tests/Makefile.test4 @@ -1,5 +1,7 @@ rule1: echo Toto + echo Tata + echo Tutu rule2: - @echo Toto + @echo Toto encore