####################################################################### # # 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. # # ####################################################################### if DEBUG TARGET_CFG = Debug CFLAGS += -v -w else TARGET_CFG = Release endif SUBDIRS = DIST_SUBDIRS = EXTRA_DIST = *.exp CASAROOT = ../.. if cpu_64 CASALIBDIR = $(CASAROOT)/lib64 OBJDIR = $(TARGET_CFG)/lib64 else CASALIBDIR = $(CASAROOT)/lib OBJDIR = $(TARGET_CFG)/lib endif BUILD_VER = 1.1.1 # handle Mono secondary dependencies export MONO_PATH := $(MONO_PATH) PLATFORMINDEPENDENTSOURCEDIR = .. PLATFORMDEPENDENTSOURCEDIR = . MODULE_NAME =libmicasa MODULE_EXT =so CFILES = ../sscs_ll.c \ ../sscs_ndk.c CSFILES_CSC := INCLUDES = -I. -I.. -I$(CASAROOT)/include -I/opt/gnome/include/gnome-keyring-1/ EXTRA_CFLAGS = RESOURCES = CFLAGS += $(EXTRA_CFLAGS) $(INCLUDES) $(DEFINES) LIBS = -L/$(CASALIBDIR)/$(TARGET_CFG) LDFLAGS = -Wl,-Bsymbolic -shared -Wl,--version-script=micasa_lux.exp \ -Wl,-rpath -Wl,/usr/lib -L/usr/lib -lpthread \ -lc -ldl -Wl,-soname -Wl,libmicasa.so.1 OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o)) #COMMON_OBJS = -L/../../c_common/linux/$(OBJDIR) ../../c_common/linux/$(OBJDIR)/sscs_ll.o COMMON_OBJS = $(OBJDIR)/sscs_ll.o CUR_DIR := $(shell pwd) all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) # # Pattern based rules. # vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR) vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR) $(OBJDIR)/%.o: %.c $(CC) -c $(CFLAGS) -o $@ $< $(OBJDIR)/%.o: %.cpp $(CC) -c $(CFLAGS) -o $@ $< $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER): $(OBJDIR) $(OBJS) @echo [======== Linking $@ ========] cc $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(CASALIBDIR)/$(TARGET_CFG)/libmicasacache.a cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) ln -sf $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).1 ln -sf $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT) $(OBJDIR): [ -d $(OBJDIR) ] || mkdir -p $(OBJDIR) [ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR) [ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG) install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(mkinstalldirs) $(DESTDIR)$(libdir) $(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/ uninstall-local: cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) 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