From 82b1cce1bc5c91c0b56501f5dab912390206ace5 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Thu, 20 Jun 2024 20:39:08 +0900 Subject: Use cli and gui as shared libraries --- src/Makefile.am | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index a2817d3..7094734 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,6 @@ bin_PROGRAMS = calculer AM_CFLAGS = -Wall -Wextra +calculer_CFLAGS = $(AM_CFLAGS) AM_LDFLAGS = calculer_SOURCES = calculer.c disp.c @@ -7,16 +8,32 @@ if DEBUG_COND noinst_LTLIBRARIES = ray.la ray_la_SOURCES = ray.c ray_la_LDFLAGS = -module -rpath @abs_srcdir@ -lraylib -else + +noinst_LTLIBRARIES += cli.la +cli_la_SOURCES = cli.c +cli_la_LDFLAGS = -module -rpath @abs_srcdir@ + +if USE_READLINE_COND +cli_la_LDFLAGS += -lreadline +else # USE_READLINE_COND +EXTRA_cli_la_SOURCES = linenoise.c +cli_la_AM_CFLAGS = -I../linenoise/ +BUILT_SOURCES: linenoise_lib.c +linenoise_lib.c: + cp ../linenoise/linenoise.c ./$@ +endif # USE_READLINE_COND + +else # DEBUG_COND AM_CFLAGS += -DNDEBUG -Wno-unused-variable -endif if USE_READLINE_COND AM_LDFLAGS += -lreadline -else +else # USE_READLINE_COND calculer_SOURCES += linenoise.c AM_CFLAGS += -I../linenoise/ BUILT_SOURCES: linenoise.c linenoise.c: - cp ../linenoise/linenoise.c . -endif + cp ../linenoise/linenoise.c ./$@ +endif # USE_READLINE_COND + +endif # DEBUG_COND -- cgit v1.2.3