Created
April 16, 2015 13:35
-
-
Save paoneJP/cfa8650e20b33e4506d4 to your computer and use it in GitHub Desktop.
auxiliary makefile for building apache module on various linux distro.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module_name=$(patsubst mod_%,%,$(shared:%.la=%)) | |
ifneq ($(wildcard /etc/debian_version),) | |
# Debian/Ubuntu | |
top_srcdir=/usr/share/apache2 | |
top_builddir=/usr/share/apache2 | |
include /usr/share/apache2/build/special.mk | |
loader_file=/etc/apache2/mods-available/$(module_name).load | |
loader_lines=LoadModule $(module_name)_module $(libexecdir)/mod_$(module_name).so | |
else ifneq ($(wildcard /etc/redhat-release),) | |
# RHEL/CentOS | |
top_srcdir=/etc/httpd | |
ifneq ($(wildcard /usr/lib64),) # 64bit | |
top_builddir=/usr/lib64/httpd | |
include /usr/lib64/httpd/build/special.mk | |
else | |
top_builddir=/usr/lib/httpd | |
include /usr/lib/httpd/build/special.mk | |
endif | |
ifneq ($(wildcard /etc/httpd/conf.modules.d),) # CentOS7 | |
loader_file=/etc/httpd/conf.modules.d/99-$(module_name).conf- | |
else | |
loader_file=/etc/httpd/conf.d/$(module_name).conf- | |
endif | |
loader_lines=LoadModule $(module_name)_module modules/mod_$(module_name).so | |
else | |
$(error unsupported platform) | |
endif | |
install-loader-config: | |
echo -e "$(loader_lines)" > $(loader_file) | |
chmod 644 $(loader_file) | |
install: install-modules-yes install-loader-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Makefile -- Build procedure for sample your_module Apache module | |
## Autogenerated via ``apxs -n your_module -g''. | |
## | |
builddir=. | |
#top_srcdir=/usr/share/apache2 | |
#top_builddir=/usr/share/apache2 | |
#include /usr/share/apache2/build/special.mk | |
include distro_support.mk | |
# the used tools | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment