diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 18 | ||||
-rw-r--r-- | src/calculer.c | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 006ee7f..88d970c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,19 @@ bin_PROGRAMS = calculer -AM_CFLAGS = -Wall -Wextra -I../linenoise/ -calculer_SOURCES = calculer.c linenoise.c -BUILT_SOURCES: linenoise.c +AM_CFLAGS = -Wall -Wextra +AM_LDFLAGS = +calculer_SOURCES = calculer.c + +if DEBUG_COND +else +AM_CFLAGS += -DNDEBUG -Wno-unused-variable +endif +if USE_READLINE_COND +AM_LDFLAGS += -lreadline +else +calculer_SOURCES += linenoise.c +AM_CFLAGS += -I../linenoise/ +BUILT_SOURCES: linenoise.c linenoise.c: cp ../linenoise/linenoise.c . +endif diff --git a/src/calculer.c b/src/calculer.c index 8d13052..be11895 100644 --- a/src/calculer.c +++ b/src/calculer.c @@ -25,7 +25,7 @@ #include <time.h> #include <unistd.h> -#include "linenoise.h" +#include "_readline.h" static int lower = 0; static int upper = 100; @@ -169,7 +169,7 @@ main(int argc, char *argv[]) sprintf(prompt, "%d + %d = ", x, y); void *measure_data = measure_before(); - input = linenoise(prompt); + input = readline(prompt); if ((!input) || (*input == '\0')) { |