X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=.Makefile.inc;h=9f51019e031e6d69f0de6259faca4ac9bf5fba94;hb=a8878569083bfa4753e9e118adee0ed1da6a0325;hp=901ced4fb214b9300d5772572d5165a4d325cf65;hpb=5c93325b53342095f7f7ba0339e4f3ea52229dfe;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/.Makefile.inc b/.Makefile.inc index 901ced4fb..9f51019e0 100644 --- a/.Makefile.inc +++ b/.Makefile.inc @@ -6,15 +6,11 @@ # Please do not edit unless you know what you're doing. # -@GNU_ONLY MAKESTYLE = gnu -@GNU_ONLY COMPILE_ROOT ?= $(shell pwd) -@BSD_ONLY MAKESTYLE = bsd -@BSD_ONLY COMPILE_ROOT != pwd - CC = @CC@ SYSTEM = @SYSTEM@ +BUILDPATH = @BUILD_DIR@ SOCKETENGINE = @SOCKETENGINE@ -CXXFLAGS = -pipe -fPIC -DPIC +CXXFLAGS += -pipe -fPIC -DPIC LDLIBS = -pthread -lstdc++ LDFLAGS = SHARED = -shared -rdynamic @@ -25,7 +21,6 @@ CONPATH = "@CONFIG_DIR@" MODPATH = "@MODULE_DIR@" BINPATH = "@BINARY_DIR@" LAUNCHDPATH = "/System/Library/LaunchDaemons" -LIBPATH = "@LIBRARY_DIR@" INSTMODE = 0755 @IFEQ $(CC) icc @@ -45,11 +40,13 @@ INSTMODE = 0755 CXXFLAGS += -DDARWIN -frtti LDLIBS += -ldl SHARED = -bundle -twolevel_namespace -undefined dynamic_lookup - CORE_FLAGS = -dynamic -bind_at_load -L. + CORELDFLAGS = -dynamic -bind_at_load -L. +@ELSIFEQ $(SYSTEM) interix + CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include @ENDIF @IFDEF D - CXXFLAGS += -g3 + CXXFLAGS += -g3 -Werror HEADER = debug-header @ELSE CXXFLAGS += -g1 @@ -57,21 +54,24 @@ INSTMODE = 0755 @ENDIF FOOTER = finishmessage -CXXFLAGS += -I$(COMPILE_ROOT)/include +CXXFLAGS += -Iinclude @GNU_ONLY MAKEFLAGS += --no-print-directory +@GNU_ONLY SOURCEPATH = $(shell /bin/pwd) +@BSD_ONLY SOURCEPATH != /bin/pwd + @IFDEF V RUNCC = $(CC) VERBOSE = -v @ELSE @GNU_ONLY MAKEFLAGS += --silent @BSD_ONLY MAKE += -s - RUNCC = $(COMPILE_ROOT)/make/run-cc.pl $(CC) + RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC) @ENDIF @DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS -@DO_EXPORT BASE CONPATH MODPATH BINPATH LIBPATH +@DO_EXPORT BASE CONPATH MODPATH BINPATH SOURCEPATH BUILDPATH # Default target TARGET = all @@ -91,11 +91,9 @@ TARGET = all all: $(FOOTER) -dep: - @cd src; ../make/calcdep.pl `perl -e 'print join " ", <*.cpp>, , , , '` socketengines/$(SOCKETENGINE).cpp threadengines/threadengine_pthread.cpp - -target: $(HEADER) dep - $(MAKEENV) $(MAKE) -C src -f ../make/$(MAKESTYLE)-real.mk $(TARGET) +target: $(HEADER) + $(MAKEENV) perl make/calcdep.pl + $(MAKEENV) $(MAKE) -C $(BUILDPATH) -f real.mk $(TARGET) debug: @${MAKE} D=1 all @@ -118,7 +116,7 @@ mod-header: @echo 'Building single module:' mod-footer: target - @echo 'To install, copy src/$(TARGET) to $(MODPATH)' + @echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)' @echo 'Or, run "make install"' std-header: @@ -142,14 +140,14 @@ finishmessage: target install: target@EXTRA_DIR@ @-install -d -m $(INSTMODE) $(BASE) - @-install -d -m $(INSTMODE) $(LIBPATH) + @-install -d -m $(INSTMODE) $(BASE)/data + @-install -d -m $(INSTMODE) $(BASE)/logs @-install -d -m $(INSTMODE) $(BINPATH) @-install -d -m $(INSTMODE) $(CONPATH) @-install -d -m $(INSTMODE) $(MODPATH) - -install -m $(INSTMODE) src/commands/*.so $(LIBPATH) - -install -m $(INSTMODE) src/modules/*.so $(MODPATH) + -install -m $(INSTMODE) $(BUILDPATH)/modules/*.so $(MODPATH) + -install -m $(INSTMODE) $(BUILDPATH)/bin/inspircd $(BINPATH) -install -m $(INSTMODE) @STARTSCRIPT@ $(@DESTINATION@) 2>/dev/null - -install -m $(INSTMODE) src/inspircd $(BINPATH) @$(MAKEENV) make/install-extras.pl install @echo "" @echo "*************************************" @@ -161,17 +159,24 @@ install: target@EXTRA_DIR@ @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *" @echo "*************************************" +@GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries) +@GNU_ONLY GNUmakefile: .Makefile.inc configure .config.cache $(RCS_FILES) +@GNU_ONLY ./configure -update + clean: @echo Cleaning... - @rm -f src/inspircd src/modes/modeclasses.a - @rm -f src/*.so src/modules/*.so src/commands/*.so src/modules/*/*.so - @rm -f src/*.o src/*/*.o src/modules/*/*.o - @rm -f src/.*.d src/*/.*.d src/modules/*/.*.d + @-rm -f src/inspircd src/modes/modeclasses.a include/inspircd_se_config.h + @-rm -f src/*.so src/modules/*.so src/commands/*.so + @-rm -f src/*.o src/*/*.o src/modules/*/*.o + @-rm -f src/.*.d src/*/.*.d src/modules/*/.*.d + @-rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk + @-rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules + @-rmdir $(BUILDPATH)/bin 2>/dev/null + @-rmdir $(BUILDPATH) 2>/dev/null @echo Completed. deinstall: -rm $(BINPATH)/inspircd - -rm $(LIBPATH)/*.so -rm $(MODPATH)/*.so @make/install-extras.pl deinstall @@ -189,7 +194,7 @@ configureclean: rm -f BSDmakefile rm -f GNUmakefile rm -f include/inspircd_config.h - rm -f include/inspircd_se_config.h + rm -f include/inspircd_version.h distclean: clean configureclean @@ -209,10 +214,9 @@ help: @echo ' Currently installs to ${BASE}' @echo ' debug Compile a debug build. Equivalent to "make D=1 all"' @echo '' - @echo ' M=m_foo Builds a single module' - @echo ' T=target Builds a user-specified target' - @echo ' Target can be a file path relative to src/, or one of:' - @echo ' inspircd commands modules' + @echo ' M=m_foo Builds a single module (cmd_foo also works here)' + @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"' + @echo ' Other targets are specified by their path in the build directory' @echo ' Multiple targets may be separated by a space' @echo '' @echo ' clean Cleans object files produced by the compile' @@ -221,4 +225,4 @@ help: @echo ' deinstall Removes the files created by "make install"' @echo -.PHONY: all dep target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help +.PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean launchd_dir configureclean help