mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
configure now generates to files for pkg-config: znc.pc and znc-uninstalled.pc This is supposed to replace the znc-config binary. Everything which can be done with znc-config can now also be done with pkg-config. znc-uninstalled.pc is only generated by configure, but not installed by the Makefiles. It's there to fix some kind of bug we have with znc-config. ZNC can run quite fine from the source, there is no need to ever run "make install". The only problem is that e.g. znc-extra won't build, since it gets -I/usr/local/include/znc from znc-config which doesn't work since znc was never installed. pkg-config has a nice fix for this: If you ask for "a", but "a-uninstalled" exists, pkg-config will use the later one instead. This is used in znc-uninstalled.pc to output a different -I flag which works for the uninstalled headers. (You only have to set $PKG_CONFIG_PATH to znc's source dir for this to work) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1503 726aef4b-f618-498e-8847-2d620e286838
93 lines
2.4 KiB
Makefile
93 lines
2.4 KiB
Makefile
# Support out-of-tree builds
|
|
srcdir := @srcdir@
|
|
VPATH := @srcdir@
|
|
|
|
prefix := @prefix@
|
|
exec_prefix := @exec_prefix@
|
|
datarootdir := @datarootdir@
|
|
bindir := @bindir@
|
|
datadir := @datadir@
|
|
sysconfdir := @sysconfdir@
|
|
libdir := @libdir@
|
|
includedir := @includedir@
|
|
sbindir := @sbindir@
|
|
localstatedir := @localstatedir@
|
|
CXX := @CXX@
|
|
CXXFLAGS := @CPPFLAGS@ @CXXFLAGS@
|
|
LDFLAGS := @LDFLAGS@
|
|
LIBS := @LIBS@
|
|
LIBZNC := @LIBZNC@
|
|
LIBZNCDIR:= @LIBZNCDIR@
|
|
PKGCONFIGDIR := $(prefix)/lib/pkgconfig
|
|
|
|
LIB_SRCS := ZNCString.cpp Csocket.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
|
|
DCCSock.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp MD5.cpp Buffer.cpp Utils.cpp \
|
|
FileUtils.cpp HTTPSock.cpp Template.cpp ClientCommand.cpp
|
|
BIN_SRCS := main.cpp
|
|
LIB_OBJS := $(patsubst %cpp,%o,$(LIB_SRCS))
|
|
BIN_OBJS := $(patsubst %cpp,%o,$(BIN_SRCS))
|
|
CLEAN := znc *.o core core.*
|
|
DISTCLEAN := Makefile config.log config.status znc-config znc-buildmod .depend \
|
|
modules/.depend modules/Makefile man/Makefile
|
|
|
|
.PHONY: all man modules clean distclean install
|
|
|
|
all: znc man @MODTARGET@ $(LIBZNC)
|
|
|
|
ifeq "$(LIBZNC)" ""
|
|
OBJS := $(BIN_OBJS) $(LIB_OBJS)
|
|
|
|
znc: $(OBJS)
|
|
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
else
|
|
znc: $(BIN_OBJS) $(LIBZNC)
|
|
$(CXX) $(LDFLAGS) -o $@ $(BIN_OBJS) -L. -lznc -Wl,-rpath,$(LIBZNCDIR) $(LIBS)
|
|
|
|
$(LIBZNC): $(LIB_OBJS)
|
|
$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS)
|
|
endif
|
|
|
|
man:
|
|
@$(MAKE) -C man
|
|
|
|
modules: $(LIBZNC)
|
|
@if test -n "@MODTARGET@"; then \
|
|
$(MAKE) -C modules; \
|
|
else \
|
|
echo "Modules are not enabled"; \
|
|
fi
|
|
|
|
clean:
|
|
rm -rf $(CLEAN)
|
|
@if test -n "@MODTARGET@"; then \
|
|
$(MAKE) -C modules clean; \
|
|
fi
|
|
@$(MAKE) -C man clean
|
|
|
|
distclean: clean
|
|
rm -rf $(DISTCLEAN)
|
|
|
|
%.o: %.cpp Makefile
|
|
@mkdir -p .depend
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $< -MMD -MF .depend/$@.dep
|
|
|
|
install: znc $(LIBZNC)
|
|
mkdir -p $(DESTDIR)$(bindir)
|
|
mkdir -p $(DESTDIR)$(includedir)/znc
|
|
mkdir -p $(DESTDIR)$(PKGCONFIGDIR)
|
|
install -m 0755 znc $(DESTDIR)$(bindir)
|
|
install -m 0755 znc-config $(DESTDIR)$(bindir)
|
|
install -m 0755 znc-buildmod $(DESTDIR)$(bindir)
|
|
install -m 0644 $(srcdir)/*.h $(DESTDIR)$(includedir)/znc
|
|
install -m 0644 znc.pc $(DESTDIR)$(PKGCONFIGDIR)
|
|
@if test -n "$(LIBZNC)"; then \
|
|
mkdir -p $(DESTDIR)$(LIBZNCDIR) ; \
|
|
install -m 0755 $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) ; \
|
|
fi
|
|
@if test -n "@MODTARGET@"; then \
|
|
$(MAKE) -C modules install DESTDIR=$(DESTDIR); \
|
|
fi
|
|
@$(MAKE) -C man install DESTDIR=$(DESTDIR)
|
|
|
|
-include $(wildcard .depend/*.dep)
|