# Makefile. NOTE: every recipe line below begins with a real TAB character — that is what make
# requires, and it is the single most common way a hand-edited Makefile breaks. Recipes are
# `echo` only, deliberately: this is a parsing fixture and running it must do nothing.

BUILD_DIR   := build
DIST_DIR    := dist
VERSION     ?= 1.4.0
SOURCES     := $(wildcard src/*.c)
OBJECTS     := $(SOURCES:src/%.c=$(BUILD_DIR)/%.o)
CFLAGS      += -O2 -Wall

.DEFAULT_GOAL := all
.PHONY: all build test package clean help

all: build test

build: $(BUILD_DIR)
	@echo "compiling $(words $(SOURCES)) source files with $(CFLAGS)"

$(BUILD_DIR):
	@echo "would create $(BUILD_DIR)"

test: build
	@echo "running tests for version $(VERSION)"

package: build
	@echo "would package $(BUILD_DIR) into $(DIST_DIR)/app-$(VERSION).tar.gz"

clean:
	@echo "would remove $(BUILD_DIR) and $(DIST_DIR)"

help:
	@echo "targets: all build test package clean"
