Makefile: respect and use LIBS (Thanks Kacper)
This commit is contained in:
parent
93f906308d
commit
3749ed2fbe
2
Makefile
2
Makefile
|
@ -25,7 +25,7 @@ src/%.o: src/%.c ${HEADERS}
|
|||
|
||||
all: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
|
||||
echo "LINK i3"
|
||||
$(CC) -o i3 $^ $(LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o i3 $^ $(LIBS)
|
||||
|
||||
loglevels.h:
|
||||
echo "LOGLEVELS"
|
||||
|
|
34
common.mk
34
common.mk
|
@ -49,23 +49,23 @@ CPPFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
|
|||
CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
|
||||
CPPFLAGS += -DTERM_EMU=\"$(TERM_EMU)\"
|
||||
|
||||
LDFLAGS += -lm
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-event, xcb-event)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-keysyms, xcb-keysyms)
|
||||
LIBS += -lm
|
||||
LIBS += $(call ldflags_for_lib, xcb-event, xcb-event)
|
||||
LIBS += $(call ldflags_for_lib, xcb-keysyms, xcb-keysyms)
|
||||
ifeq ($(shell pkg-config --exists xcb-util || echo 1),1)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-atom, xcb-atom)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-aux, xcb-aux)
|
||||
LIBS += $(call ldflags_for_lib, xcb-atom, xcb-atom)
|
||||
LIBS += $(call ldflags_for_lib, xcb-aux, xcb-aux)
|
||||
else
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-util)
|
||||
LIBS += $(call ldflags_for_lib, xcb-util)
|
||||
endif
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-icccm, xcb-icccm)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-xinerama, xcb-xinerama)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb-randr, xcb-randr)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcb, xcb)
|
||||
LDFLAGS += $(call ldflags_for_lib, xcursor, Xcursor)
|
||||
LDFLAGS += $(call ldflags_for_lib, x11, X11)
|
||||
LDFLAGS += $(call ldflags_for_lib, yajl, yajl)
|
||||
LDFLAGS += $(call ldflags_for_lib, libev, ev)
|
||||
LIBS += $(call ldflags_for_lib, xcb-icccm, xcb-icccm)
|
||||
LIBS += $(call ldflags_for_lib, xcb-xinerama, xcb-xinerama)
|
||||
LIBS += $(call ldflags_for_lib, xcb-randr, xcb-randr)
|
||||
LIBS += $(call ldflags_for_lib, xcb, xcb)
|
||||
LIBS += $(call ldflags_for_lib, xcursor, Xcursor)
|
||||
LIBS += $(call ldflags_for_lib, x11, X11)
|
||||
LIBS += $(call ldflags_for_lib, yajl, yajl)
|
||||
LIBS += $(call ldflags_for_lib, libev, ev)
|
||||
|
||||
ifeq ($(UNAME),NetBSD)
|
||||
# We need -idirafter instead of -I to prefer the system’s iconv over GNU libiconv
|
||||
|
@ -75,12 +75,12 @@ endif
|
|||
|
||||
ifeq ($(UNAME),OpenBSD)
|
||||
CFLAGS += -I${X11BASE}/include
|
||||
LDFLAGS += -liconv
|
||||
LIBS += -liconv
|
||||
LDFLAGS += -L${X11BASE}/lib
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME),FreeBSD)
|
||||
LDFLAGS += -liconv
|
||||
LIBS += -liconv
|
||||
endif
|
||||
|
||||
# Fallback for libyajl 1 which did not include yajl_version.h. We need
|
||||
|
@ -102,7 +102,7 @@ endif
|
|||
|
||||
ifeq ($(COVERAGE),1)
|
||||
CFLAGS += -fprofile-arcs -ftest-coverage
|
||||
LDFLAGS += -lgcov
|
||||
LIBS += -lgcov
|
||||
endif
|
||||
|
||||
# Don’t print command lines which are run
|
||||
|
|
|
@ -15,7 +15,7 @@ HEADERS:=$(wildcard *.h)
|
|||
|
||||
all: cfgparse.y.o cfgparse.yy.o ${FILES}
|
||||
echo "LINK i3-config-wizard"
|
||||
$(CC) -o i3-config-wizard $^ $(LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o i3-config-wizard $^ $(LIBS)
|
||||
|
||||
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
|
||||
echo "LEX $<"
|
||||
|
|
|
@ -14,7 +14,7 @@ HEADERS=$(wildcard *.h)
|
|||
|
||||
all: ${FILES}
|
||||
echo "LINK i3-input"
|
||||
$(CC) -o i3-input ${FILES} $(LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o i3-input ${FILES} $(LIBS)
|
||||
|
||||
install: all
|
||||
echo "INSTALL"
|
||||
|
|
|
@ -16,7 +16,7 @@ HEADERS=$(wildcard *.h)
|
|||
|
||||
all: ${FILES}
|
||||
echo "LINK i3-msg"
|
||||
$(CC) -o i3-msg ${FILES} $(LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
|
||||
|
||||
install: all
|
||||
echo "INSTALL"
|
||||
|
|
|
@ -14,7 +14,7 @@ HEADERS=$(wildcard *.h)
|
|||
|
||||
all: ${FILES}
|
||||
echo "LINK i3-nagbar"
|
||||
$(CC) -o i3-nagbar ${FILES} $(LDFLAGS)
|
||||
$(CC) $(LDFLAGS) -o i3-nagbar ${FILES} $(LIBS)
|
||||
|
||||
install: all
|
||||
echo "INSTALL"
|
||||
|
|
Loading…
Reference in New Issue