even more fixes

This commit is contained in:
Gu://em_ 2025-10-31 23:12:01 +01:00
parent 4b3df88e8a
commit db4bf470ff
3 changed files with 11 additions and 13 deletions

View file

@ -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

View file

@ -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;
}
}

View file

@ -1,5 +1,7 @@
rule1:
echo Toto
echo Tata
echo Tutu
rule2:
@echo Toto
@echo Toto encore