diff --git a/pscat/Makefile b/pscat/Makefile index 0353c73..c9a0cb0 100644 --- a/pscat/Makefile +++ b/pscat/Makefile @@ -1,22 +1,13 @@ -CFLAGS = -g -RM = rm -f -TARGETS = pscat +pscat: pscat.o psargs.o + $(CC) $(CFLAGS) -g -o pscat psargs.o pscat.o -all: $(TARGETS) +pscat.o: pscat.c + $(CC) $(CFLAGS) -c -o pscat.o pscat.c + +psargs.o: psargs.c + $(CC) $(CFLAGS) -c -o psargs.o psargs.c clean: - $(RM) $(TARGETS) *.o + rm -f *.o pscat -debug: - $(CC) $(DEBUG) -o pscat pscat.c - -%.o: %.c %.h - $(CC) $(CFLAGS) -c -o %.o %.c - -pscat.o: psargs.h pscat.c - $(CC) $(CFLAGS) -DUSE_ASCII_H -DDONT_USE_SYSTEM_SYSEXITS -c -o pscat.o pscat.c - -pscat: pscat.o psargs.o - $(CC) $(CFLAGS) -o pscat psargs.o pscat.o - -.PHONY: all clean +.PHONY: clean diff --git a/pscat/pscat.c b/pscat/pscat.c index f671a8a..6203e84 100644 --- a/pscat/pscat.c +++ b/pscat/pscat.c @@ -1,7 +1,8 @@ -#include -#include -#include -#include +#include /* fprintf(3), stderr */ +#include /* EX_USAGE */ +#include /* execvp(3) */ +#include /* */ +#include /* wait(2) */ #include "psargs.h" @@ -31,7 +32,7 @@ forking(char **argv){ int main(int argc, char *argv[]){ - if((check_arg(++argv, L_PAREN, R_PAREN)) == 0){ + if(check_arg(++argv, L_PAREN, R_PAREN) == 0){ fprintf(stderr, "Usage: %s \"[\" [utility [argument...]] \"]\" ...\n", argv[-1] == NULL ? program_name : argv[-1]