aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-20 20:39:08 +0900
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-20 20:39:08 +0900
commit82b1cce1bc5c91c0b56501f5dab912390206ace5 (patch)
treeccb0b9b293b6dccfdc95cbd657fb63227274dc41 /src/Makefile.am
parent685ec81e127c9409a91299a5ac8415bb94f55ad9 (diff)
Use cli and gui as shared libraries
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am27
1 files changed, 22 insertions, 5 deletions
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