Makefile.linux.mk revision 5d0dcd9820c04ac52a150525298eaae50c8b3544
2N/A#
2N/A# The contents of this file are subject to the terms of the Common Development and
2N/A# Distribution License (the License). You may not use this file except in compliance with the
2N/A# License.
2N/A#
2N/A# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2N/A# specific language governing permission and limitations under the License.
2N/A#
2N/A# When distributing Covered Software, include this CDDL Header Notice in each file and include
2N/A# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
2N/A# Header, with the fields enclosed by brackets [] replaced by your own identifying
2N/A# information: "Portions copyright [year] [name of copyright owner]".
2N/A#
2N/A# Copyright 2014 - 2015 ForgeRock AS.
2N/A#
2N/A
2N/Aifndef LINUX_MK_INCLUDED
2N/ALINUX_MK_INCLUDED := true
2N/A
2N/ACC := gcc44
2N/ASHARED := -shared
2N/A
2N/ACFLAGS += -fPIC -pthread -D_REENTRANT -DLINUX -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector \
2N/A -Wno-unused-value -Wno-deprecated-declarations
2N/A
2N/Aifdef DEBUG
2N/A CFLAGS += -g3 -fno-inline -O0 -DDEBUG -Wall
2N/Aelse
2N/A CFLAGS += -g -O2 -DNDEBUG
2N/Aendif
2N/A
2N/Aifdef 64
2N/A CFLAGS += -m64 -DLINUX_64
2N/A LDFLAGS += -m64
2N/Aelse
2N/A CFLAGS += -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
2N/A LDFLAGS += -m32
2N/Aendif
2N/A
2N/ALDFLAGS += -Wl,-rpath,'$$ORIGIN/../lib' -Wl,-rpath,'$$ORIGIN' -Wl,--no-as-needed -Wl,-z,nodelete -lpthread -lresolv -lrt -ldl
2N/A
2N/Alibopenam: $(OUT_OBJS)
2N/A @$(ECHO) "[*** Creating "$@" shared library ***]"
2N/A ${CC} $(SHARED) -fPIC -Wl,-soname,libopenam.so $(LDFLAGS) $(OUT_OBJS) -o build/libopenam.so
2N/A
2N/Aapache: $(OUT_OBJS) $(APACHE_OUT_OBJS)
2N/A @$(ECHO) "[*** Creating "$@" shared library ***]"
2N/A ${CC} $(SHARED) -fPIC -Wl,-soname,mod_openam.so $(LDFLAGS) \
2N/A $(OUT_OBJS) -Wl,--version-script=source/apache/agent.map $(APACHE_OUT_OBJS) -o build/mod_openam.so
2N/A
apache22: apache22_pre $(OUT_OBJS) $(APACHE22_OUT_OBJS) apache22_post
@$(ECHO) "[*** Creating "$@" shared library ***]"
${CC} $(SHARED) -fPIC -Wl,-soname,mod_openam.so $(LDFLAGS) \
$(OUT_OBJS) -Wl,--version-script=source/apache/agent.map $(APACHE22_OUT_OBJS) -o build/mod_openam.so
iis:
$(error IIS target is not supported on this platform)
varnish: $(OUT_OBJS) $(VARNISH_OUT_OBJS)
@$(ECHO) "[*** Creating "$@" shared library ***]"
${CC} $(SHARED) -fPIC -Wl,-soname,libvmod_am.so $(LDFLAGS) \
$(OUT_OBJS) -Wl,--version-script=source/varnish/agent.map $(VARNISH_OUT_OBJS) -o build/libvmod_am.so
varnish3: $(OUT_OBJS) $(VARNISH3_OUT_OBJS)
@$(ECHO) "[*** Creating "$@" shared library ***]"
${CC} $(SHARED) -fPIC -Wl,-soname,libvmod_am.so $(LDFLAGS) \
$(OUT_OBJS) -Wl,--version-script=source/varnish3/agent.map $(VARNISH3_OUT_OBJS) -o build/libvmod_am.so
agentadmin: $(OUT_OBJS) $(ADMIN_OUT_OBJS)
@$(ECHO) "[*** Creating "$@" binary ***]"
${CC} $(CFLAGS) $(LDFLAGS) $(OUT_OBJS) $(ADMIN_OUT_OBJS) -o build/agentadmin
tests: clean build version test_includes $(OUT_OBJS) $(TEST_OBJECTS)
@$(ECHO) "[***** Building "$@" binary *****]"
${CC} $(CFLAGS) $(LDFLAGS) $(OUT_OBJS) $(TEST_OBJECTS) -o build$(PS)test
endif