Files
znc/Makefile.in
Uli Schlachter 70c7745899 Overhaul the config parsing
This moves stuff to a two-step model. First, the new class CConfig reads the
config file, parses it and creates a in-memory model of stuff. Only then do we
actually go forward and apply the stuff.

The upside of this is that some config errors are caught before we change
anything on the running upside.

Let's see how much stuff this broke...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:43:05 +02:00

146 lines
4.1 KiB
Makefile

SHELL := @SHELL@
# 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 := @DEFS@ @CPPFLAGS@ @CXXFLAGS@ -I.
LDFLAGS := @LDFLAGS@
LIBS := @LIBS@
LIBZNC := @LIBZNC@
LIBZNCDIR:= @LIBZNCDIR@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
PKGCONFIGDIR := $(libdir)/pkgconfig
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
INSTALL_SCRIPT := @INSTALL_SCRIPT@
INSTALL_DATA := @INSTALL_DATA@
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 Socket.cpp SHA256.cpp \
WebModules.cpp Listener.cpp Config.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 znc.pc znc-uninstalled.pc
CXXFLAGS += -D_MODDIR_=\"$(MODDIR)\" -D_DATADIR_=\"$(DATADIR)\"
ifneq "$(V)" ""
VERBOSE=1
endif
ifeq "$(VERBOSE)" ""
Q=@
E=@echo
C=-s
else
Q=
E=@\#
C=
endif
.PHONY: all man modules clean distclean install
all: znc man modules $(LIBZNC)
@echo ""
@echo " ZNC was successfully compiled. You may use"
@echo " '$(MAKE) install' to install ZNC to '$(prefix)'."
@echo " You can then use '$(bindir)/znc --makeconf'"
@echo " to generate a config file."
@echo ""
@echo " If you need help with using ZNC, please visit our wiki at:"
@echo " http://znc.in"
ifeq "$(LIBZNC)" ""
OBJS := $(BIN_OBJS) $(LIB_OBJS)
znc: $(OBJS)
$(E) Linking znc...
$(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
else
znc: $(BIN_OBJS) $(LIBZNC)
$(E) Linking znc...
$(Q)$(CXX) $(LDFLAGS) -o $@ $(BIN_OBJS) -L. -lznc -Wl,-rpath,$(LIBZNCDIR) $(LIBS)
$(LIBZNC): $(LIB_OBJS)
$(E) Linking $(LIBZNC)...
$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS)
endif
man:
@$(MAKE) -C man $(C)
modules: $(LIBZNC)
@$(MAKE) -C modules $(C)
clean:
rm -rf $(CLEAN)
@$(MAKE) -C modules clean;
@$(MAKE) -C man clean
distclean: clean
rm -rf $(DISTCLEAN)
%.o: %.cpp Makefile
@mkdir -p .depend
$(E) Building $@...
$(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< -MMD -MF .depend/$@.dep
install: znc $(LIBZNC)
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(includedir)/znc
mkdir -p $(DESTDIR)$(PKGCONFIGDIR)
mkdir -p $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)
cp -R $(srcdir)/webskins $(DESTDIR)$(DATADIR)
find $(DESTDIR)$(DATADIR)/webskins -type d -exec chmod 0755 '{}' \;
find $(DESTDIR)$(DATADIR)/webskins -type f -exec chmod 0644 '{}' \;
$(INSTALL_PROGRAM) znc $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) znc-config $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) znc-buildmod $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(srcdir)/*.h $(DESTDIR)$(includedir)/znc
$(INSTALL_DATA) znc.pc $(DESTDIR)$(PKGCONFIGDIR)
@$(MAKE) -C modules install DESTDIR=$(DESTDIR);
if test -n "$(LIBZNC)"; then \
mkdir -p $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
$(INSTALL_PROGRAM) $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
fi
@$(MAKE) -C man install DESTDIR=$(DESTDIR)
uninstall:
rm $(DESTDIR)$(bindir)/znc
rm $(DESTDIR)$(bindir)/znc-config
rm $(DESTDIR)$(bindir)/znc-buildmod
rm $(DESTDIR)$(includedir)/znc/*.h
rm $(DESTDIR)$(PKGCONFIGDIR)/znc.pc
rm -rf $(DESTDIR)$(DATADIR)/webskins
if test -n "$(LIBZNC)"; then \
rm $(DESTDIR)$(LIBZNCDIR)/$(LIBZNC) || exit 1 ; \
rmdir $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
fi
@$(MAKE) -C man uninstall DESTDIR=$(DESTDIR)
@if test -n "modules"; then \
$(MAKE) -C modules uninstall DESTDIR=$(DESTDIR); \
fi
rmdir $(DESTDIR)$(bindir)
rmdir $(DESTDIR)$(includedir)/znc
rmdir $(DESTDIR)$(PKGCONFIGDIR)
@echo "Successfully uninstalled, but empty directories were left behind"
-include $(wildcard .depend/*.dep)