#
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
#
# Makefile for libSUNWfbconf_xorg.so
#
include Makefile.common
VPATH =$(FBC_SRC_DIR):$(XF86_SRC_DIR)
#
# Preprocessor flags
#
XF86_DEFINE = -DSMI_FBCONFIG
FBC_DEFINE = $(DEFINE) $(XF86_DEFINE)
FBC_INC = -I$(FBC_SRC_DIR) -I$(XF86_SRC_DIR)
FBC_INC += -I$(GFX_COMMON)/include
FBC_INC += -I$(COMMON) -I$(COMMON)/include
#
# Linker flags
#
LIBS = $(L_XF86) $(L_GFX) -lm
#
# Code modules
#
FBC_HDRS = \
fbc.h \
FBC_CSRCS = \
FBC_OBJ_FILES = $(FBC_CSRCS:.c=.o)
FBC_OBJS = $(FBC_OBJ_FILES:%=$(FBC_BIN_DIR)/%)
XF86_HDRS = \
all: $(FBC_BIN_DIR) $(BIN_DIR)/$(LIB_FBC_SO)$(VERS)
# Library build rules
$(BIN_DIR)/$(LIB_FBC_SO)$(VERS): $(FBC_OBJS) $(GFX_BIN_DIR)/$(LIB_GFX_A) $(XF86_BIN_DIR)/$(LIB_XF86_A)
rm -f $(BIN_DIR)/$(LIB_FBC_SO)
$(CC) $(LIB_LDFLAGS) $(FBC_OBJS) $(LIBS) $(DYNLIBFLAGS) -o $@
ln -s $@ $(BIN_DIR)/$(LIB_FBC_SO)
$(GFX_BIN_DIR)/$(LIB_GFX_A): Makefile.gfx
$(MAKE) -f Makefile.gfx all
$(XF86_BIN_DIR)/$(LIB_XF86_A): Makefile.xf86
$(MAKE) -f Makefile.xf86 all
# Component-specific compilation rule
$(FBC_BIN_DIR)/%.o: $(FBC_SRC_DIR)/%.c $(FBC_HDRS)
$(CC) $(FBC_DEFINE) $(FBC_INC) $(CFLAGS) -c -o $@ $<
# Directories
$(FBC_BIN_DIR):
[ -d $@ ] || mkdir -p $@
#install: all $(INSTALL_LIB_DIR)/$(LIB_FBC_SO) $(INSTALL_LIB_DIR)/$(LIB_FBC_SO)$(VERS)
install: $(INSTALL_LIB_DIR)/$(LIB_FBC_SO) $(INSTALL_LIB_DIR)/$(LIB_FBC_SO)$(VERS)
$(INSTALL_LIB_DIR)/$(LIB_FBC_SO)$(VERS): $(LIB_FBC_SO)$(VERS)
$(INSTALL) -m 0555 $? $@
$(INSTALL_LIB_DIR)/$(LIB_FBC_SO): $(LIB_FBC_SO)$(VERS)
-rm -f $@
ln -s $(LIB_FBC_SO)$(VERS) $@
clean:
-rm -f $(FBC_OBJS) $(FBC_SRC_DIR)/*~
$(MAKE) -f Makefile.xf86 clean
$(MAKE) -f Makefile.gfx clean
clobber: clean
-rm -f $(BIN_DIR)/$(LIB_FBC_SO)$(VERS) $(BIN_DIR)/$(LIB_FBC_SO)
$(MAKE) -f Makefile.xf86 clobber
$(MAKE) -f Makefile.gfx clobber
# End of Makefile.fbc