fix: Makefile install prefix missing for libtoml.pc #68

This commit is contained in:
CK Tan 2021-12-16 13:36:32 -08:00
parent 8434e75006
commit 64e280e20b
2 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,4 @@
prefix ?= /usr/local
HFILES = toml.h
CFILES = toml.c
OBJ = $(CFILES:.c=.o)
@ -35,14 +36,15 @@ toml_cat: toml_cat.c $(LIB)
toml_sample: toml_sample.c $(LIB)
prefix ?= /usr/local
install: all
install -d ${prefix}/include ${prefix}/lib
install toml.h ${prefix}/include
install $(LIB) ${prefix}/lib
install $(LIB_SHARED) ${prefix}/lib
install $(PCFILE) /usr/lib/pkgconfig
ifeq "$(prefix)" "/usr/local"
install $(PCFILE) /usr/local/lib/pkgconfig
endif
clean:
rm -f *.o $(EXEC) $(LIB) $(LIB_SHARED)

View file

@ -1,4 +1,4 @@
prefix=/usr/local/
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
@ -8,4 +8,4 @@ URL: https://github.com/cktan/tomlc99/
Description: TOML C library in c99.
Version: v1.0
Libs: -L${libdir} -ltoml
Cflags: -I${includedir}
Cflags: -I${includedir}