aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.mk
diff options
context:
space:
mode:
authorGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-14 21:47:28 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-14 21:47:28 (JST)
commita9a7f68244b3393725643b35fb3f685b05ccea9e (patch)
treef2930b542e1b5815e56b569affa661e38a030f7b /cgit.mk
parent027e88a1a150cd468943cda3a4b8e6bd6e662376 (diff)
downloadcgit-a9a7f68244b3393725643b35fb3f685b05ccea9e.zip
cgit-a9a7f68244b3393725643b35fb3f685b05ccea9e.tar.gz
makefile: only display lua message once
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cgit.mk')
-rw-r--r--cgit.mk15
1 files changed, 7 insertions, 8 deletions
diff --git a/cgit.mk b/cgit.mk
index deef9a7..056c3f9 100644
--- a/cgit.mk
+++ b/cgit.mk
@@ -25,10 +25,8 @@ ifdef NO_C99_FORMAT
25 CFLAGS += -DNO_C99_FORMAT 25 CFLAGS += -DNO_C99_FORMAT
26endif 26endif
27 27
28nullstring :=
29fourspace := $(nullstring)
30ifdef NO_LUA 28ifdef NO_LUA
31 $(info $(fourspace)* building without specified Lua support) 29 LUA_MESSAGE := linking without specified Lua support
32 CGIT_CFLAGS += -DNO_LUA 30 CGIT_CFLAGS += -DNO_LUA
33else 31else
34LUAJIT_CFLAGS := $(shell pkg-config --cflags luajit 2>/dev/null) 32LUAJIT_CFLAGS := $(shell pkg-config --cflags luajit 2>/dev/null)
@@ -39,26 +37,26 @@ ifeq (JIT,$(LUA_IMPLEMENTATION))
39 ifeq ($(strip $(LUAJIT_LIBS)),) 37 ifeq ($(strip $(LUAJIT_LIBS)),)
40 $(error LuaJIT specified via LUA_IMPLEMENTATION=JIT, but library could not be found.) 38 $(error LuaJIT specified via LUA_IMPLEMENTATION=JIT, but library could not be found.)
41 endif 39 endif
42 $(info $(fourspace)* building with selected LuaJIT) 40 LUA_MESSAGE := linking with selected LuaJIT
43 CGIT_LIBS += $(LUAJIT_LIBS) 41 CGIT_LIBS += $(LUAJIT_LIBS)
44 CGIT_CFLAGS += $(LUAJIT_CFLAGS) 42 CGIT_CFLAGS += $(LUAJIT_CFLAGS)
45else ifeq (VANILLA,$(LUA_IMPLEMENTATION)) 43else ifeq (VANILLA,$(LUA_IMPLEMENTATION))
46 ifeq ($(strip $(LUA_LIBS)),) 44 ifeq ($(strip $(LUA_LIBS)),)
47 $(error Lua specified via LUA_IMPLEMENTATION=VANILLA, but library could not be found.) 45 $(error Lua specified via LUA_IMPLEMENTATION=VANILLA, but library could not be found.)
48 endif 46 endif
49 $(info $(fourspace)* building with selected Lua) 47 LUA_MESSAGE := linking with selected Lua
50 CGIT_LIBS += $(LUA_LIBS) 48 CGIT_LIBS += $(LUA_LIBS)
51 CGIT_LIBS += $(LUA_CFLAGS) 49 CGIT_LIBS += $(LUA_CFLAGS)
52else ifneq ($(strip $(LUAJIT_LIBS)),) 50else ifneq ($(strip $(LUAJIT_LIBS)),)
53 $(info $(fourspace)* building with autodetected LuaJIT) 51 LUA_MESSAGE := linking with autodetected LuaJIT
54 CGIT_LIBS += $(LUAJIT_LIBS) 52 CGIT_LIBS += $(LUAJIT_LIBS)
55 CGIT_CFLAGS += $(LUAJIT_CFLAGS) 53 CGIT_CFLAGS += $(LUAJIT_CFLAGS)
56else ifneq ($(strip $(LUA_LIBS)),) 54else ifneq ($(strip $(LUA_LIBS)),)
57 $(info $(fourspace)* building with autodetected Lua) 55 LUA_MESSAGE := linking with autodetected Lua
58 CGIT_LIBS += $(LUA_LIBS) 56 CGIT_LIBS += $(LUA_LIBS)
59 CGIT_CFLAGS += $(LUA_CFLAGS) 57 CGIT_CFLAGS += $(LUA_CFLAGS)
60else 58else
61 $(info $(fourspace)* building without autodetected Lua support) 59 LUA_MESSAGE := linking without autodetected Lua support
62 NO_LUA := YesPlease 60 NO_LUA := YesPlease
63 CGIT_CFLAGS += -DNO_LUA 61 CGIT_CFLAGS += -DNO_LUA
64endif 62endif
@@ -133,4 +131,5 @@ $(CGIT_OBJS): %.o: %.c GIT-CFLAGS $(CGIT_PREFIX)CGIT-CFLAGS $(missing_dep_dirs)
133 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $(CGIT_CFLAGS) $< 131 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $(CGIT_CFLAGS) $<
134 132
135$(CGIT_PREFIX)cgit: $(CGIT_OBJS) GIT-LDFLAGS $(GITLIBS) 133$(CGIT_PREFIX)cgit: $(CGIT_OBJS) GIT-LDFLAGS $(GITLIBS)
134 @echo 1>&1 " * $(LUA_MESSAGE)"
136 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) $(CGIT_LIBS) 135 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) $(CGIT_LIBS)