2009-01-14 21:11:12 +01:00
|
|
|
# Makefile for GNU make
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
include Makefile.dep
|
2011-06-06 22:35:56 +02:00
|
|
|
|
2016-03-17 14:46:20 +01:00
|
|
|
|
|
|
|
# https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors
|
|
|
|
GLOBAL_WORKING_DIR := $(shell pwd)/../..
|
2018-11-23 18:53:43 +01:00
|
|
|
|
2016-03-17 14:46:20 +01:00
|
|
|
|
2016-03-18 09:56:19 +01:00
|
|
|
current_path := $(shell pwd)
|
|
|
|
global_relative_working_dir := $(shell relative_path $(current_path) $(GLOBAL_WORKING_DIR))
|
|
|
|
|
2016-03-17 14:46:20 +01:00
|
|
|
|
|
|
|
|
2016-02-01 12:12:54 +01:00
|
|
|
ifeq ($(CXX), g++)
|
2018-01-01 01:14:02 +01:00
|
|
|
CXX = g++6
|
2016-02-01 12:12:54 +01:00
|
|
|
endif
|
|
|
|
|
2016-01-31 20:52:17 +01:00
|
|
|
ifndef CXX
|
2014-06-07 13:20:44 +02:00
|
|
|
ifeq ($(OSTYPE), FreeBSD)
|
|
|
|
CXX = clang++
|
|
|
|
else
|
2018-01-01 01:14:02 +01:00
|
|
|
CXX = g++6
|
2014-06-07 13:20:44 +02:00
|
|
|
endif
|
2016-01-31 20:52:17 +01:00
|
|
|
endif
|
2014-06-07 13:20:44 +02:00
|
|
|
|
2016-01-31 20:52:17 +01:00
|
|
|
# CXX = g++-4.8
|
2010-02-15 01:31:14 +01:00
|
|
|
|
|
|
|
ifndef CXXFLAGS
|
2021-07-13 01:49:58 +02:00
|
|
|
CXXFLAGS = -Wall -O0 -g -fPIC -pthread -std=c++20 -I/usr/local/include -I/usr/include/postgresql -I$(GLOBAL_WORKING_DIR)/pikotools/src -I$(GLOBAL_WORKING_DIR)/ezc/src -I$(GLOBAL_WORKING_DIR)/morm/src -DPT_HAS_MORM_LIBRARY -DEZC_HAS_MORM_LIBRARY -DMORM_HAS_EZC_LIBRARY
|
2013-10-15 23:57:51 +02:00
|
|
|
endif
|
|
|
|
|
2014-11-12 05:14:16 +01:00
|
|
|
ifndef AR
|
|
|
|
AR = ar
|
|
|
|
endif
|
2013-10-15 23:57:51 +02:00
|
|
|
|
2021-05-11 22:22:03 +02:00
|
|
|
winix_include_paths = -I$(global_relative_working_dir)/winix/winixd -I$(global_relative_working_dir)/ezc/src -I$(global_relative_working_dir)/tito/src -I$(global_relative_working_dir)/morm/src -I$(global_relative_working_dir)/pikotools/src
|
2010-02-15 01:31:14 +01:00
|
|
|
|
2012-06-30 20:37:52 +02:00
|
|
|
ifndef LDFLAGS
|
|
|
|
LDFLAGS = -L/usr/local/lib
|
|
|
|
endif
|
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
# for make install
|
|
|
|
winix_install_dir = /usr/local/winix
|
|
|
|
|
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
|
2016-03-17 14:46:20 +01:00
|
|
|
export GLOBAL_WORKING_DIR
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 01:31:14 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2011-06-06 22:35:56 +02:00
|
|
|
all: winix.so plugins winix
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2010-08-18 00:32:47 +02:00
|
|
|
|
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
winix.so: $(winix.src.files)
|
2012-01-08 04:59:51 +01:00
|
|
|
@cd core ; $(MAKE) -e
|
2021-02-24 01:19:47 +01:00
|
|
|
@cd models ; $(MAKE) -e
|
2012-01-08 04:59:51 +01:00
|
|
|
@cd db ; $(MAKE) -e
|
|
|
|
@cd functions ; $(MAKE) -e
|
|
|
|
@cd notify ; $(MAKE) -e
|
|
|
|
@cd templates ; $(MAKE) -e
|
2016-03-17 14:46:20 +01:00
|
|
|
@cd $(GLOBAL_WORKING_DIR)/ezc/src ; $(MAKE) -e
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/tito/src ; $(MAKE) -e
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/pikotools ; $(MAKE) -e
|
2018-03-13 23:34:59 +01:00
|
|
|
@cd $(GLOBAL_WORKING_DIR)/morm/src ; $(MAKE) -e
|
2021-09-22 00:23:25 +02:00
|
|
|
$(CXX) -shared -rdynamic -Wl,-whole-archive -o winix.so $(CXXFLAGS) $(winix_include_paths) core/*.o db/*.o models/*.o functions/*.o templates/*.o notify/*.o $(GLOBAL_WORKING_DIR)/ezc/src/ezc.a $(GLOBAL_WORKING_DIR)/tito/src/tito.a $(GLOBAL_WORKING_DIR)/pikotools/src/pikotools.a $(GLOBAL_WORKING_DIR)/morm/src/morm.a $(LDFLAGS) -lfcgi -lpq -lz -lpthread -lcurl -lmagic -Wl,-no-whole-archive
|
2011-06-06 22:35:56 +02:00
|
|
|
|
|
|
|
|
2013-10-15 23:57:51 +02:00
|
|
|
winix: winix.so $(winix.src.files)
|
|
|
|
@cd main ; $(MAKE) -e
|
2014-02-12 17:30:49 +01:00
|
|
|
$(CXX) -o winix $(CXXFLAGS) $(LDFLAGS) main/*.o winix.so -lfcgi
|
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
|
|
|
|
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:
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd core ; $(MAKE) -e clean
|
|
|
|
@cd db ; $(MAKE) -e clean
|
2021-02-24 01:19:47 +01:00
|
|
|
@cd models ; $(MAKE) -e clean
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd functions ; $(MAKE) -e clean
|
|
|
|
@cd templates ; $(MAKE) -e clean
|
|
|
|
@cd notify ; $(MAKE) -e clean
|
|
|
|
@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
|
2016-03-17 14:46:20 +01:00
|
|
|
@cd $(GLOBAL_WORKING_DIR)/ezc/src ; $(MAKE) -e clean
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/tito/src ; $(MAKE) -e clean
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/pikotools ; $(MAKE) -e clean
|
2018-03-13 23:34:59 +01:00
|
|
|
@cd $(GLOBAL_WORKING_DIR)/morm/src ; $(MAKE) -e clean
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd main ; $(MAKE) -e clean
|
2010-01-28 16:39:01 +01:00
|
|
|
rm -f winix.so
|
|
|
|
rm -f winix
|
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:
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd core ; $(MAKE) -e depend
|
|
|
|
@cd db ; $(MAKE) -e depend
|
2021-02-24 01:19:47 +01:00
|
|
|
@cd models ; $(MAKE) -e depend
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd functions ; $(MAKE) -e depend
|
|
|
|
@cd templates ; $(MAKE) -e depend
|
|
|
|
@cd notify ; $(MAKE) -e depend
|
|
|
|
@cd plugins/stats ; $(MAKE) -e depend
|
|
|
|
@cd plugins/thread ; $(MAKE) -e depend
|
|
|
|
@cd plugins/ticket ; $(MAKE) -e depend
|
|
|
|
@cd plugins/gallery ; $(MAKE) -e depend
|
2011-10-16 23:33:45 +02:00
|
|
|
@cd plugins/group ; $(MAKE) -e depend
|
2011-07-14 01:14:10 +02:00
|
|
|
@cd plugins/menu ; $(MAKE) -e depend
|
2011-07-29 00:18:10 +02:00
|
|
|
@cd plugins/export ; $(MAKE) -e depend
|
2016-01-31 20:52:17 +01:00
|
|
|
@cd plugins/mailregister ; $(MAKE) -e depend
|
2019-03-14 14:33:40 +01:00
|
|
|
@cd plugins/seo ; $(MAKE) -e depend
|
2016-03-17 14:46:20 +01:00
|
|
|
@cd $(GLOBAL_WORKING_DIR)/ezc/src ; $(MAKE) -e depend
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/tito/src ; $(MAKE) -e depend
|
|
|
|
@cd $(GLOBAL_WORKING_DIR)/pikotools ; $(MAKE) -e depend
|
2011-06-06 22:35:56 +02:00
|
|
|
@cd main ; $(MAKE) -e depend
|
2013-10-15 23:57:51 +02:00
|
|
|
echo -n "winix.src.files = " > Makefile.dep
|
2018-03-13 23:34:59 +01:00
|
|
|
find -E . -type f -regex ".*\.h|.*\.cpp" | xargs -I foo echo -n foo " " >> Makefile.dep
|
2016-03-18 09:56:19 +01:00
|
|
|
# use $(global_relative_working_dir) here to put relative paths to Makefile.dep
|
|
|
|
find -E $(global_relative_working_dir)/ezc/src -type f -regex ".*\.h|.*\.cpp" | xargs -I foo echo -n foo " " >> Makefile.dep
|
|
|
|
find -E $(global_relative_working_dir)/tito/src -type f -regex ".*\.h|.*\.cpp" | xargs -I foo echo -n foo " " >> Makefile.dep
|
2021-05-11 22:22:03 +02:00
|
|
|
find -E $(global_relative_working_dir)/pikotools/src -type f -regex ".*\.h|.*\.cpp" | xargs -I foo echo -n foo " " >> Makefile.dep
|
2018-03-13 23:34:59 +01:00
|
|
|
find -E $(global_relative_working_dir)/morm/src -type f -regex ".*\.h|.*\.cpp" | xargs -I foo echo -n foo " " >> Makefile.dep
|
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
|
|
|
|
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
|
2013-10-15 23:57:51 +02:00
|
|
|
rm -Rf $(winix_install_dir)/etc
|
|
|
|
mkdir -p $(winix_install_dir)/etc
|
2014-02-12 21:49:50 +01:00
|
|
|
cp -rf etc/* $(winix_install_dir)/etc/
|
2010-08-18 00:32:47 +02:00
|
|
|
# html templates
|
2013-10-15 23:57:51 +02:00
|
|
|
rm -Rf $(winix_install_dir)/html
|
|
|
|
mkdir -p $(winix_install_dir)/html
|
2014-02-12 21:49:50 +01:00
|
|
|
cp -rf html/* $(winix_install_dir)/html/
|
2010-12-06 01:32:12 +01:00
|
|
|
# txt templates
|
2013-10-15 23:57:51 +02:00
|
|
|
rm -Rf $(winix_install_dir)/txt
|
|
|
|
mkdir -p $(winix_install_dir)/txt
|
2014-02-12 21:49:50 +01:00
|
|
|
cp -rf txt/* $(winix_install_dir)/txt/
|
2010-08-18 00:32:47 +02:00
|
|
|
# locales
|
2013-10-15 23:57:51 +02:00
|
|
|
rm -Rf $(winix_install_dir)/locale
|
|
|
|
mkdir -p $(winix_install_dir)/locale
|
2014-02-12 21:49:50 +01:00
|
|
|
cp -rf locale/* $(winix_install_dir)/locale/
|
2010-08-18 00:32:47 +02:00
|
|
|
# plugins
|
2013-10-15 23:57:51 +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/
|
|
|
|
# deleting subversion directories
|
|
|
|
find $(winix_install_dir) -type d -name ".svn" | xargs -I foo rm -fr foo
|
|
|
|
# removing privileges for others
|
|
|
|
find $(winix_install_dir) -exec chmod o-r,o-x,o-w "{}" "+"
|
|
|
|
|