diff --git a/.gitignore b/.gitignore index 97bd5f6..78c3597 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ ex*-c +aoc-c core ex*-cob lib/ diff --git a/2021/Makefile b/2021/Makefile index 82e9dd1..0e4101a 100644 --- a/2021/Makefile +++ b/2021/Makefile @@ -17,7 +17,7 @@ CC = gcc #LIBS = -lreadline -lncurses CFLAGS += -std=gnu99 -#CFLAGS += -O2 +CFLAGS += -O2 CFLAGS += -g CFLAGS += -Wall CFLAGS += -Wextra @@ -39,13 +39,12 @@ LDLIB := -l$(LIB) all: lib $(SUBDIRS) clean: - for dir in $(SUBDIRS) ; do \ - $(MAKE) -C $$dir clean ; \ + @for dir in $(SUBDIRS) ; do \ + $(MAKE) --no-print-directory -C $$dir clean ; \ done cleanall: clean - echo AAAAAAAAAAAAAAAAAAAAA - $(RM) -f $(SLIB) $(DLIB) + @$(RM) -f $(SLIB) $(DLIB) redo: cleanall all @@ -54,10 +53,10 @@ $(SUBDIRS): @echo "================= $@ =================" @echo "=========================================" @echo - @echo "+++++++++++++++++ ex1" - +$(MAKE) --no-print-directory -C $@ ex1 2>&1 - @echo "+++++++++++++++++ ex2" - +$(MAKE) --no-print-directory -C $@ ex2 2>&1 + @echo "+++++++++++++++++ part 1" + +@$(MAKE) --no-print-directory -C $@ ex1 2>&1 + @echo "+++++++++++++++++ part 2" + +@$(MAKE) --no-print-directory -C $@ ex2 2>&1 output: @$(MAKE) --no-print-directory all >OUTPUT 2>&1 @@ -65,17 +64,17 @@ output: lib: $(DLIB) $(SLIB) $(SLIB): $(LIBOBJ) - @#echo ZZZZZZZZZZZZZZZZZZZZ $(SLIB) $(DLIB) - mkdir -p $(LIBDIR) - $(AR) $(ARFLAGS) -o $@ $^ + @echo building $@ static library. + @mkdir -p $(LIBDIR) + @$(AR) $(ARFLAGS) -o $@ $^ $(DLIB): CFLAGS += -fPIC $(DLIB): LDFLAGS += -shared $(DLIB): $(LIBOBJ) - @#echo YYYYYYYYYYYYYYYYYYYY $(SLIB) $(DLIB) - mkdir -p $(LIBDIR) - $(CC) $(LDFLAGS) $^ -o $@ + @echo building $@ shared library. + @mkdir -p $(LIBDIR) + @$(CC) $(LDFLAGS) $^ -o $@ .c.o: - echo TOTO - $(CC) -c $(CFLAGS) $(LDFLAGS) -I $(INCDIR) -o $@ $< + @echo compiling $<. + @$(CC) -c $(CFLAGS) $(LDFLAGS) -I $(INCDIR) -o $@ $< diff --git a/2021/OUTPUT b/2021/OUTPUT new file mode 100644 index 0000000..e93d1e1 --- /dev/null +++ b/2021/OUTPUT @@ -0,0 +1,14 @@ +========================================= +================= day01 ================= +========================================= + ++++++++++++++++++ part 1 +aoc-c : res=1195 + time: 0:00.00 real, 0.00 user, 0.00 sys + context-switch: 2+1, page-faults: 0+87 + ++++++++++++++++++ part 2 +aoc-c : res=1235 + time: 0:00.00 real, 0.00 user, 0.00 sys + context-switch: 2+1, page-faults: 0+87 + diff --git a/2021/day01/Makefile b/2021/day01/Makefile index 98ed3d9..8b0eac6 100644 --- a/2021/day01/Makefile +++ b/2021/day01/Makefile @@ -50,4 +50,5 @@ clean: @rm -f aoc-c core* .c: - $(CC) $(CFLAGS) $(LDFLAGS) -I $(INCDIR) $< $(LDLIB) -o $@ + @echo compiling $< + @$(CC) $(CFLAGS) $(LDFLAGS) -I $(INCDIR) $< $(LDLIB) -o $@