# Makefile for the Subgrid Marching Tetrahedron C implementation.
#
#   make           build a minimal example (./minimal) and a command-line tool (./sgmt)
#   make clean     remove build products
#
# The library is header-only; only the example programs need to be compiled.

CC      ?= cc
CSTD    ?= -std=c99
CFLAGS  ?= $(CSTD) -O2 -Wall -Wextra -pedantic
LDLIBS  ?= -lm

.PHONY: all clean

all: sgmt minimal

sgmt: cli.c subgrid_marching_tet.h
	$(CC) $(CFLAGS) -o $@ cli.c $(LDLIBS)

minimal: minimal.c subgrid_marching_tet.h
	$(CC) $(CFLAGS) -o $@ minimal.c $(LDLIBS)

clean:
	rm -f sgmt minimal
