From 59df84609a64b8d12d97826b43b2ebca38db02dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 7 Aug 2020 21:00:15 +0200 Subject: [PATCH] :wrench: install static library --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index cce625de..d06d293d 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ CFLAGS += -Iinclude ifeq (${BUILD_ON_WINDOWS}, 1) ifeq (${CC}, gcc) -LDFLAGS += -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--out-implib=libgwion.dll.a +LDFLAGS += -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--out-implib=lib${PRG}.dll.a LDFLAGS += -lm endif else @@ -52,18 +52,17 @@ endif CFLAGS += -DGWION_BUILTIN -#GWLIBS = libgwion.a ast/libgwion_ast.a ast/libgwion_grammar.a util/libgwion_util.a -GWLIBS = libgwion.a ast/libgwion_ast.a util/libgwion_util.a +GWLIBS = lib${PRG}.a ast/libgwion_ast.a util/libgwion_util.a _LDFLAGS = ${GWLIBS} ${LDFLAGS} -all: options-show util/libgwion_util.a ast/libgwion_ast.a libgwion.a src/main.o +all: options-show util/libgwion_util.a ast/libgwion_ast.a lib${PRG}.a src/main.o $(info link ${PRG}) @${CC} src/main.o -o ${PRG} ${_LDFLAGS} ${LIBS} options-show: @$(call _options) -libgwion.a: ${lib_obj} +lib${PRG}.a: ${lib_obj} @${AR} ${AR_OPT} util/libgwion_util.a: @@ -92,11 +91,12 @@ clean_core: clean: clean_core $(info cleaning ...) - @rm -f src/*.o src/*/*.o gwion libgwion.a src/*.gcno src/*.gcda + @rm -f src/*.o src/*/*.o gwion lib${PRG}.a src/*.gcno src/*.gcda install: ${PRG} $(info installing ${GWION_PACKAGE} in ${PREFIX}) @install ${PRG} ${DESTDIR}/${PREFIX}/bin + @install lib${PRG}.a ${DESTDIR}/${PREFIX}/lib @sed 's/PREFIX/$\{PREFIX\}/g' scripts/gwion-config > gwion-config @install gwion-config ${DESTDIR}/${PREFIX}/bin/gwion-config @install scripts/gwion-pkg ${DESTDIR}/${PREFIX}/bin/gwion-pkg -- 2.43.0