Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3bdbe33..98d2c46 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,15 @@ UTF8_SUPPORT=yes DESTDIR=/ CONFIG_FILE=$(DESTDIR)/etc/multitail.conf -CC=gcc +CC?=gcc +PKG_CONFIG?=pkg-config DEBUG=-g -D_FORTIFY_SOURCE=2 # -D_DEBUG # -pg # -D_DEBUG #-pg -W -pedantic # -pg #-fprofile-arcs ifeq ($(UTF8_SUPPORT),yes) -LDFLAGS+=-lpanelw -lncursesw -lutil -lm $(DEBUG) -rdynamic -CFLAGS+=-funsigned-char -D`uname` -O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -DUTF8_SUPPORT +LIBS+=`$(PKG_CONFIG) --libs ncursesw panelw` -lutil -lm +CFLAGS+=-funsigned-char -D`uname` -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -DUTF8_SUPPORT else -LDFLAGS+=-lpanel -lncurses -lutil -lm $(DEBUG) -rdynamic -CFLAGS+=-funsigned-char -D`uname` -O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" +LIBS+=`$(PKG_CONFIG) --libs ncurses panel` -lutil -lm +CFLAGS+=-funsigned-char -D`uname` -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" endif OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o @@ -19,10 +20,10 @@ OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox. all: multitail multitail: $(OBJS) - $(CC) -Wall -W $(OBJS) $(LDFLAGS) -o multitail + $(CC) $(CFLAGS) $(LDFLAGS) -Wall -W $(OBJS) -o multitail $(LIBS) multitail_ccmalloc: $(OBJS) - ccmalloc --no-wrapper $(CC) -Wall -W $(OBJS) $(LDFLAGS) -o ccmultitail + ccmalloc --no-wrapper $(CC) $(CFLAGS) $(LDFLAGS) -Wall -W $(OBJS) -o ccmultitail $(LIBS) install: multitail cp multitail $(DESTDIR)/usr/bin