CASA/CASA-auth-token/server/AuthTokenValidate/Svc/linux/Makefile.am

131 lines
3.4 KiB
Makefile

#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Juan Carlos Luciani <jluciani@novell.com>
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
DEFINES = -DDBG
else
TARGET_CFG = Release
DEFINES = -DNDEBUG
endif
# Override the link setting for C++
LINK = g++
SUBDIRS =
DIST_SUBDIRS =
ROOT = ../../..
LIBDIR = $(ROOT)/$(LIB)
BINDIR = $(ROOT)/$(BIN)
IBM_JAVA_LIBDIR = /usr/lib/jvm/jre-1.5.0/bin
SUN_JAVA_LIBDIR = /usr/lib/jvm/jre-1.5.0/lib/$(HOSTTYPE)/server
JAVA_INCDIR = /usr/lib/jvm/java-1.5.0/include
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
MODULE_NAME = CasaAuthtokenValidateD
CFILES =
CPPFILES = server.cpp
CSFILES_CSC :=
INCLUDES = -I. -I$(ROOT)/include -I$(JAVA_INCDIR) -I$(JAVA_INCDIR)/linux
RESOURCES =
if LIB64
DEFINES += -D_LIB64
endif
CFLAGS += -Wno-format-extra-args -fno-strict-aliasing $(INCLUDES) $(DEFINES)
CPPFLAGS += -Wno-format-extra-args -fno-strict-aliasing -fPIC $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
if IBM_JVM
LIBS += -lpthread -lcasa_s_ipc -ljvm -ljsig -lj9thr23 -ldl
LDFLAGS += -L$(LIBDIR)/$(TARGET_CFG) -L$(IBM_JAVA_LIBDIR) -L$(IBM_JAVA_LIBDIR)/classic
else
LIBS += -lpthread -lcasa_s_ipc -ljvm -ljsig
LDFLAGS += -L$(LIBDIR)/$(TARGET_CFG) -L$(SUN_JAVA_LIBDIR)
endif
OBJDIR = ./$(TARGET_CFG)/$(LIB)
OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o)) $(addprefix $(OBJDIR)/, $(CPPFILES:%.cpp=%.o))
EXTRA_DIST = $(CFILES) $(CPPFILES) *.h CasaAuthtokenValidateD envvars
CUR_DIR := $(shell pwd)
all: $(OBJDIR)/$(MODULE_NAME)
#
# Pattern based rules.
#
vpath %.c .
vpath %.cpp .
$(OBJDIR)/%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR)/%.o: %.cpp
$(CC) -c $(CPPFLAGS) -o $@ $<
$(OBJDIR)/$(MODULE_NAME): $(OBJDIR) $(OBJS)
@echo [======== Linking $@ ========]
$(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
cp -f $(OBJDIR)/$(MODULE_NAME) $(BINDIR)/$(TARGET_CFG)/$(MODULE_NAME)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(LIBDIR) ] || mkdir -p $(LIBDIR)
[ -d $(LIBDIR)/$(TARGET_CFG) ] || mkdir -p $(LIBDIR)/$(TARGET_CFG)
[ -d $(BINDIR) ] || mkdir -p $(BINDIR)
[ -d $(BINDIR)/$(TARGET_CFG) ] || mkdir -p $(BINDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME)
rmdir $(DESTDIR)$(libdir)
#installcheck-local: install
# $(mkinstalldirs) $(DESTDIR)$(libdir)
# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir)
# cd $(DESTDIR)$(libdir); $(MONO)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in