2017-03-18 21:20:51 +00:00
|
|
|
CC = gcc
|
|
|
|
CFILES = toml.c
|
|
|
|
|
|
|
|
CFLAGS = -std=c99 -Wall -Wextra
|
|
|
|
CFLAGS += -O2 -DNDEBUG
|
|
|
|
#CFLAGS += -O0 -g
|
|
|
|
|
2017-08-07 21:47:59 +00:00
|
|
|
EXEC = toml_json toml_cat
|
2017-03-18 21:20:51 +00:00
|
|
|
|
|
|
|
LIB = libtoml.a
|
|
|
|
|
|
|
|
all: $(LIB) $(EXEC)
|
|
|
|
|
|
|
|
|
|
|
|
libtoml.a: toml.o
|
|
|
|
ar -rcs $@ $^
|
|
|
|
|
|
|
|
toml_json: toml_json.c $(LIB)
|
|
|
|
|
2017-08-07 21:47:59 +00:00
|
|
|
toml_cat: toml_cat.c $(LIB)
|
|
|
|
|
2017-03-18 21:20:51 +00:00
|
|
|
prefix ?= /usr/local
|
|
|
|
|
|
|
|
install: all
|
|
|
|
install -d ${prefix}/include ${prefix}/lib
|
|
|
|
install toml.h ${prefix}/include
|
|
|
|
install libtoml.a ${prefix}/lib
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o $(EXEC) $(LIB)
|