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