Skip to content

Commit

Permalink
Refactor the debug targets
Browse files Browse the repository at this point in the history
  • Loading branch information
zedr committed Jul 11, 2023
1 parent 0a2902c commit 05f42f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build/
old
_*.c
_*.h
*.out
.idea
.cores
tmp/
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 05f42f7

Please sign in to comment.