More examples

This commit is contained in:
Leonardo Vencovsky committed 2023-01-24 22:23:33 +01:00
1 parent 301f080713
commit a8c1619be6
6 files changed
+306 -4

No files matched your search

+31 -3
View File
@@ -1,9 +1,37 @@
CC=gcc
CFLAGS=-Wall -Wextra -Werror
CFLAGS=-Wall -Wextra -Werror -O3
INCLUDE=-I ../src
dfs: dfs.c
$(CC) $< -o $@.exe $(CFLAGS) $(INCLUDE)
./$@.exe
example: example.c
$(CC) $< -o $@.exe $(CFLAGS) $(INCLUDE)
./$@.exe
run: example
./example.exe
hanoi: hanoi.c
$(CC) $< -o $@.exe $(CFLAGS) $(INCLUDE)
./$@.exe
heapsort: heapsort.c
$(CC) $< -o $@.exe $(CFLAGS) $(INCLUDE)
./$@.exe
sieve: sieve.c
$(CC) $< -o $@.exe $(CFLAGS) $(INCLUDE)
./$@.exe
clean:
rm *.exe
rm *.txt
memcheck:
ifndef FILE
$(error FILE parameter must be set first to check for leaks)
else
$(CC) $(FILE) -o mem.exe $(CFLAGS) $(INCLUDE) -g
valgrind --leak-check=yes ./mem.exe
endif