-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefiles with own, less verbose output.
- Loading branch information
1 parent
f12b69c
commit 63ef9d6
Showing
25 changed files
with
353 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 19 additions & 3 deletions
22
chapter_2.types_operators_expressions/2_01.ranges/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=ranges | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=loop | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=htoi | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
25 changes: 0 additions & 25 deletions
25
chapter_2.types_operators_expressions/2_04.sqeeze/Makefile
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
chapter_2.types_operators_expressions/2_04.squeeze/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
BINARY=squeeze | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=any | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
22 changes: 19 additions & 3 deletions
22
chapter_2.types_operators_expressions/2_06.setbits/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=setbits | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
22 changes: 19 additions & 3 deletions
22
chapter_2.types_operators_expressions/2_07.invert/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
BINARY=invert | ||
|
||
CFILES=$(wildcard *.c) | ||
TESTDIR=./tests/ | ||
TESTDIR=tests/ | ||
TESTS=$(wildcard $(TESTDIR)*.tin) | ||
TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS)) | ||
|
||
CC=gcc | ||
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89 | ||
|
||
ANSIGREEN="\033[32m" | ||
ANSIYELLOW="\033[33m" | ||
ANSIBOLD="\033[1m" | ||
ANSIRST="\033[0m" | ||
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] " | ||
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST) | ||
|
||
MAKEFLAGS+=--silent | ||
|
||
all: $(BINARY) | ||
|
||
$(BINARY): $(CFILES) | ||
echo -n "** Building "$(ANSIYBIN)":" | ||
$(CC) $(CFLAGS) -o $@ $^ | ||
echo $(ANSIGOK) | ||
|
||
check: $(TEST_RESULTS) | ||
echo "** "$(ANSIBOLD)$(ANSIYBIN)" test results:"$(ANSIBOLD)$(ANSIGOK) | ||
|
||
%.res: %.tin | ||
@./$(BINARY) <$? >$@ult | ||
@diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo -n "- Testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ | ||
$(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) | ||
./$(BINARY) <$? >$@ult | ||
diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) | ||
echo $(ANSIGOK) | ||
|
||
clean: | ||
echo -n "** Cleaning "$(ANSIYBIN)":" | ||
rm -f $(BINARY) | ||
rm -f $(TESTDIR)*.result | ||
echo $(ANSIGOK) |
Oops, something went wrong.