diff --git a/.gitignore b/.gitignore index 7e57cd7..87ff2bf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/ old _*.c _*.h +*.out .idea .cores tmp/ diff --git a/Makefile b/Makefile index e19f810..28e88e3 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,21 @@ -.PHONY: default all test clean +.PHONY: default all test clean debug CC ?= gcc STD := c99 -SHELL := /bin/bash +SHELL := /usr/bin/env bash SOURCES := src/tinycols/*.c src/queue.c INCDIR := include/ INCLUDES = $(shell find $(INCDIR) -type f -name *.h) INC := -I ${INCLUDES} -COMPILE := -g -DLINUX_TARGET -Wall -Werror -pedantic -std=${STD} +COMPILE := -DLINUX_TARGET -Wall -Werror -pedantic -std=${STD} CFLAGS := ${COMPILE} +DBG_CFLAGS := -g -p default: build/tinycols +debug: build/tinycols-debug + all: default test build: @@ -35,6 +38,11 @@ build/tinycols: build -o build/tinycols \ src/main.c src/gfx.c ${SOURCES} +build/tinycols-debug: build + @${CC} ${CFLAGS} ${DBG_CFLAGS} -std=gnu99 -lncurses \ + -o build/tinycols-debug \ + src/main.c src/gfx.c ${SOURCES} + tests: build/test_tinycols build/test_queue test: