diff --git a/test/Makefile b/test/Makefile index 8b1378917..5ca8238f9 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1 +1,19 @@ +SRCS += test-counter.c +OBJS := $(patsubst %.c,%.o,$(SRCS)) +PROGS := $(patsubst %.c,%,$(SRCS)) + +all: $(PROGS) + +$(PROGS): $(OBJS) + $(E) " LINK " $@ + $(Q) $(CC) $< -o $@ + +%.o: %.c + $(E) " CC " $@ + $(Q) $(CC) -c $(CFLAGS) $< -o $@ + +clean: + $(Q) $(RM) -f ./*.o + $(Q) $(RM) -f ./$(PROGS) +.PHONY: clean diff --git a/test/test-counter.c b/test/test-counter.c new file mode 100644 index 000000000..4d5e4d50f --- /dev/null +++ b/test/test-counter.c @@ -0,0 +1,19 @@ +#include +#include + +#include + +#include + +int main(int argc, char *argv[]) +{ + int counter = 0; + + while (1) { + printf("Pid: %10d Counter: %10d\n", + getpid(), counter++); + sleep(3); + } + + return 0; +}