2022-06-26 06:22:27 +02:00
|
|
|
# GNU Makefile
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
# sourcefiles: all *.cpp files except ./plugins subdirectory
|
|
|
|
# objfiles: corresponding *.o files
|
|
|
|
sourcefiles:=$(shell find . -name "*.cpp" -not \( -path ./plugins/\* \))
|
|
|
|
objfiles:=$(patsubst %.cpp,%.o,$(sourcefiles))
|
2011-06-06 22:35:56 +02:00
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
# sourcefiles_no_main: all *.cpp files except ./plugins and ./main subdirectories
|
|
|
|
sourcefiles_no_main:=$(shell find . -name "*.cpp" -not \( -path ./plugins/\* \) -not \( -path ./main/\* \))
|
|
|
|
objfiles_no_main:=$(patsubst %.cpp,%.o,$(sourcefiles_no_main))
|
2016-03-17 14:46:20 +01:00
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
# sourcefiles_main: all *.cpp files from ./main subdirectory
|
|
|
|
sourcefiles_main:=$(shell find main -name "*.cpp")
|
|
|
|
objfiles_main:=$(patsubst %.cpp,%.o,$(sourcefiles_main))
|
2018-11-23 18:53:43 +01:00
|
|
|
|
2016-03-17 14:46:20 +01:00
|
|
|
|
2016-03-18 09:56:19 +01:00
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
WINIX_PLUGINS_MAKEDEPEND_INCLUDES = -I../../../../winix/winixd \
|
|
|
|
-I../../../../pikotools/src \
|
|
|
|
-I../../../../morm/src \
|
|
|
|
-I../../../../ezc/src \
|
|
|
|
-I../../../../tito/src
|
|
|
|
|
|
|
|
WINIX_NEEDED_MACROS = -DPT_HAS_MORM_LIBRARY \
|
|
|
|
-DEZC_HAS_MORM_LIBRARY \
|
|
|
|
-DMORM_HAS_EZC_LIBRARY
|
2016-03-17 14:46:20 +01:00
|
|
|
|
|
|
|
|
2016-02-01 12:12:54 +01:00
|
|
|
|
2016-01-31 20:52:17 +01:00
|
|
|
ifndef CXX
|
2022-06-26 06:22:27 +02:00
|
|
|
CXX = g++
|
2016-01-31 20:52:17 +01:00
|
|
|
endif
|
2014-06-07 13:20:44 +02:00
|
|
|
|
2010-02-15 01:31:14 +01:00
|
|
|
ifndef CXXFLAGS
|
2022-09-23 19:53:26 +02:00
|
|
|
# /usr/include/postgresql is in Linux distros (Alpine)
|
2022-06-26 06:22:27 +02:00
|
|
|
CXXFLAGS = -Wall -pedantic -O2 -std=c++20 -fPIC -pthread \
|
|
|
|
-I/usr/local/include \
|
2022-09-23 19:53:26 +02:00
|
|
|
-I/usr/include/postgresql \
|
2022-06-26 06:22:27 +02:00
|
|
|
-I../../winix/winixd \
|
|
|
|
-I../../pikotools/src \
|
|
|
|
-I../../morm/src \
|
|
|
|
-I../../ezc/src \
|
|
|
|
-I../../tito/src \
|
|
|
|
$(WINIX_PLUGINS_MAKEDEPEND_INCLUDES) \
|
|
|
|
$(WINIX_NEEDED_MACROS)
|
2014-11-12 05:14:16 +01:00
|
|
|
endif
|
2013-10-15 23:57:51 +02:00
|
|
|
|
2012-06-30 20:37:52 +02:00
|
|
|
ifndef LDFLAGS
|
2022-06-26 06:22:27 +02:00
|
|
|
LDFLAGS = -L/usr/local/lib -s
|
2012-06-30 20:37:52 +02:00
|
|
|
endif
|
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
|
|
|
|
# for make install
|
2022-06-26 06:22:27 +02:00
|
|
|
WINIX_INSTALL_DIR = /usr/local/winix
|
2013-10-15 23:57:51 +02:00
|
|
|
|
2012-06-30 20:37:52 +02:00
|
|
|
|
2009-11-13 21:40:11 +01:00
|
|
|
export CXX
|
2009-04-21 22:50:55 +02:00
|
|
|
export CXXFLAGS
|
2012-06-30 20:37:52 +02:00
|
|
|
export LDFLAGS
|
2022-06-26 06:22:27 +02:00
|
|
|
export WINIX_PLUGINS_MAKEDEPEND_INCLUDES
|
|
|
|
export WINIX_NEEDED_MACROS
|
2010-02-15 01:31:14 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
all: winix winix.so plugins
|
2010-08-18 00:32:47 +02:00
|
|
|
|
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
winix: $(objfiles_main) winix.so
|
2022-07-25 14:21:21 +02:00
|
|
|
$(CXX) -o winix $(CXXFLAGS) $(LDFLAGS) $(objfiles_main) winix.so -lcurl
|
2011-06-06 22:35:56 +02:00
|
|
|
|
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
winix.so: $(objfiles_no_main)
|
|
|
|
@cd ../../pikotools ; $(MAKE) -e
|
|
|
|
@cd ../../morm ; $(MAKE) -e
|
|
|
|
@cd ../../ezc ; $(MAKE) -e
|
|
|
|
@cd ../../tito ; $(MAKE) -e
|
2022-07-25 14:21:21 +02:00
|
|
|
$(CXX) -shared -rdynamic -Wl,-whole-archive -o winix.so $(CXXFLAGS) $(objfiles_no_main) ../../pikotools/src/pikotools.a ../../morm/src/morm.a ../../ezc/src/ezc.a ../../tito/src/tito.a $(LDFLAGS) -lfcgi -lpq -lz -lpthread -lmagic -Wl,-no-whole-archive
|
2011-06-06 22:35:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
plugins: FORCE
|
2016-01-31 20:52:17 +01:00
|
|
|
@cd plugins/stats ; $(MAKE) -e
|
|
|
|
@cd plugins/thread ; $(MAKE) -e
|
|
|
|
@cd plugins/ticket ; $(MAKE) -e
|
|
|
|
@cd plugins/gallery ; $(MAKE) -e
|
|
|
|
@cd plugins/group ; $(MAKE) -e
|
|
|
|
@cd plugins/menu ; $(MAKE) -e
|
|
|
|
@cd plugins/export ; $(MAKE) -e
|
|
|
|
@cd plugins/mailregister ; $(MAKE) -e
|
2019-03-14 14:33:40 +01:00
|
|
|
@cd plugins/seo ; $(MAKE) -e
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
|
2022-06-26 06:22:27 +02:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
|
2011-06-06 22:35:56 +02:00
|
|
|
FORCE:
|
|
|
|
|
2010-08-18 00:32:47 +02:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
clean:
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -f $(objfiles)
|
|
|
|
rm -f winix.so
|
|
|
|
rm -f winix
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd plugins/stats ; $(MAKE) -e clean
|
|
|
|
@cd plugins/thread ; $(MAKE) -e clean
|
|
|
|
@cd plugins/ticket ; $(MAKE) -e clean
|
|
|
|
@cd plugins/gallery ; $(MAKE) -e clean
|
2011-10-16 23:33:45 +02:00
|
|
|
@cd plugins/group ; $(MAKE) -e clean
|
2011-07-14 01:14:10 +02:00
|
|
|
@cd plugins/menu ; $(MAKE) -e clean
|
2011-07-29 00:18:10 +02:00
|
|
|
@cd plugins/export ; $(MAKE) -e clean
|
2016-01-31 20:52:17 +01:00
|
|
|
@cd plugins/mailregister ; $(MAKE) -e clean
|
2019-03-14 14:33:40 +01:00
|
|
|
@cd plugins/seo ; $(MAKE) -e clean
|
2022-06-26 06:22:27 +02:00
|
|
|
@cd ../../pikotools ; $(MAKE) -e clean
|
|
|
|
@cd ../../morm ; $(MAKE) -e clean
|
|
|
|
@cd ../../ezc ; $(MAKE) -e clean
|
|
|
|
@cd ../../tito ; $(MAKE) -e clean
|
2008-12-30 02:05:03 +01:00
|
|
|
|
|
|
|
|
2011-06-06 22:35:56 +02:00
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
depend:
|
2022-06-26 06:22:27 +02:00
|
|
|
makedepend -Y. -I../../pikotools/src -I../../morm/src -I../../ezc/src -I../../tito/src $(WINIX_NEEDED_MACROS) -f- $(sourcefiles) > Makefile.dep
|
|
|
|
@cd plugins/stats ; $(MAKE) -e depend
|
|
|
|
@cd plugins/thread ; $(MAKE) -e depend
|
|
|
|
@cd plugins/ticket ; $(MAKE) -e depend
|
|
|
|
@cd plugins/gallery ; $(MAKE) -e depend
|
|
|
|
@cd plugins/group ; $(MAKE) -e depend
|
|
|
|
@cd plugins/menu ; $(MAKE) -e depend
|
|
|
|
@cd plugins/export ; $(MAKE) -e depend
|
|
|
|
@cd plugins/mailregister ; $(MAKE) -e depend
|
|
|
|
@cd plugins/seo ; $(MAKE) -e depend
|
|
|
|
@cd ../../pikotools ; $(MAKE) -e depend
|
|
|
|
@cd ../../morm ; $(MAKE) -e depend
|
|
|
|
@cd ../../ezc ; $(MAKE) -e depend
|
|
|
|
@cd ../../tito ; $(MAKE) -e depend
|
2011-06-06 22:35:56 +02:00
|
|
|
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2010-08-18 00:32:47 +02:00
|
|
|
|
|
|
|
install: all
|
2013-10-15 23:57:51 +02:00
|
|
|
# installing binaries
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/bin
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/bin
|
|
|
|
cp winix $(WINIX_INSTALL_DIR)/bin
|
|
|
|
cp winix.so $(WINIX_INSTALL_DIR)/bin
|
2012-06-23 01:41:12 +02:00
|
|
|
# etc configs
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/etc
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/etc
|
|
|
|
cp -rf etc/* $(WINIX_INSTALL_DIR)/etc/
|
2010-08-18 00:32:47 +02:00
|
|
|
# html templates
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/html
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/html
|
|
|
|
cp -rf html/* $(WINIX_INSTALL_DIR)/html/
|
2010-12-06 01:32:12 +01:00
|
|
|
# txt templates
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/txt
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/txt
|
|
|
|
cp -rf txt/* $(WINIX_INSTALL_DIR)/txt/
|
2010-08-18 00:32:47 +02:00
|
|
|
# locales
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/locale
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/locale
|
|
|
|
cp -rf locale/* $(WINIX_INSTALL_DIR)/locale/
|
2010-08-18 00:32:47 +02:00
|
|
|
# plugins
|
2022-06-26 06:22:27 +02:00
|
|
|
rm -Rf $(WINIX_INSTALL_DIR)/plugins
|
|
|
|
mkdir -p $(WINIX_INSTALL_DIR)/plugins
|
|
|
|
find plugins/ -name "*.so" | xargs -I foo cp foo $(WINIX_INSTALL_DIR)/plugins/
|
2013-10-15 23:57:51 +02:00
|
|
|
# removing privileges for others
|
2022-06-26 06:22:27 +02:00
|
|
|
find $(WINIX_INSTALL_DIR) -exec chmod o-r,o-x,o-w "{}" "+"
|
|
|
|
|
|
|
|
|
|
|
|
-include Makefile.dep
|
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
|