This commit is contained in:
CK Tan 2020-06-13 16:18:57 -07:00
parent cdbb9decfb
commit 5bc8f64fdd

View file

@ -1,6 +1,12 @@
HFILES = toml.h
CFILES = toml.c CFILES = toml.c
OBJ = $(CFILES:.c=.o)
EXEC = toml_json toml_cat
CFLAGS = -std=c99 -Wall -Wextra -fpic CFLAGS = -std=c99 -Wall -Wextra -fpic
LIB = libtoml.a
LIB_SHARED = libtoml.so
# to compile for debug: make DEBUG=1 # to compile for debug: make DEBUG=1
# to compile for no debug: make # to compile for no debug: make
ifdef DEBUG ifdef DEBUG
@ -9,13 +15,10 @@ else
CFLAGS += -O2 -DNDEBUG CFLAGS += -O2 -DNDEBUG
endif endif
EXEC = toml_json toml_cat
LIB = libtoml.a
LIB_SHARED = libtoml.so
all: $(LIB) $(LIB_SHARED) $(EXEC) all: $(LIB) $(LIB_SHARED) $(EXEC)
*.o: $(HFILES)
libtoml.a: toml.o libtoml.a: toml.o
ar -rcs $@ $^ ar -rcs $@ $^