Makefile revision 911
481N/A###############################################################################
481N/A#
911N/A# libdps Makefile
919N/A#
481N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
481N/A# Use is subject to license terms.
919N/A#
919N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the
919N/A# "Software"), to deal in the Software without restriction, including
919N/A# without limitation the rights to use, copy, modify, merge, publish,
919N/A# distribute, and/or sell copies of the Software, and to permit persons
919N/A# to whom the Software is furnished to do so, provided that the above
919N/A# copyright notice(s) and this permission notice appear in all copies of
919N/A# the Software and that both the above copyright notice(s) and this
919N/A# permission notice appear in supporting documentation.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
919N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
919N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
919N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
919N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
919N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
481N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
481N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
481N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
493N/A#
493N/A# Except as contained in this notice, the name of a copyright holder
481N/A# shall not be used in advertising or otherwise to promote the sale, use
481N/A# or other dealings in this Software without prior written authorization
493N/A# of the copyright holder.
481N/A#
911N/A#
911N/A
911N/A REQUIREDLIBS = -lX11 -lsocket -lnsl -lc
911N/A
481N/A# The Client Library uses definitions just like Xlib for network
481N/A# capabilities, such as TCPCONN, UNIXCONN, and DNETCONN. See
481N/A# csconndi.c and csopendi.c
481N/A
493N/A# The connection code should be rewritten to use xtrans. The STREAMSCONN
481N/A# code here needs work. For now force ConnectionFlags to be
481N/A# -DTCPCONN -DUNIXCONN
CC = cc
DEFINES = -DXDPS -DCSDPS -DTCPCONN -DUNIXCONN -DSVR4
DPSCPPFLAGS = $(DEFINES) -I ../include
DPSCFLAGS = -Kpic
SHLIBLDFLAGS = -G -z defs $(LDFLAGS) -R $(libdir)
CAT = cat
SED = sed
AWK = awk
SORT = sort
PSWRAP = ../pswrap/pswrap
COMMONOBJECTFILES = \
dpsclient.o\
dpsprintf.o\
dpsexcept.o\
dpsdict.o\
dpsabbrev.o
COMMONSOURCEFILES = \
dpsclient.c\
dpsprintf.c\
dpsexcept.c\
dpsdict.c\
dpsabbrev.c
XOBJECTFILES = \
dpsXclient.o\
dpssysnames.o\
dpsXpriv.o\
XDPS.o\
dpsXcmu.o
# dpsXtdisp.o\ - wasn't included in Solaris libdps for some reason
XSOURCEFILES = \
dpsXclient.c\
dpssysnames.c\
dpsXpriv.c\
XDPS.c\
dpsXcmu.c
# dpsXtdisp.c\ - wasn't included in Solaris libdps for some reason
XCSDPSOBJECTFILES = \
cslibext.o\
csopendi.o\
csconndi.o\
csstartNX.o\
csfindNX.o\
cslibint.o
XCSDPSSOURCEFILES = \
cslibext.c\
csopendi.c\
csconndi.c\
csstartNX.c\
csfindNX.c\
cslibint.c
DPSOPSOBJECTS = \
dpsclrops.o\
dpsctrlops.o\
dpsctxtops.o\
dpsdataops.o\
dpsfontops.o\
dpsgsttops.o\
dpsioops.o\
dpsmathops.o\
dpsmtrxops.o\
dpsmiscops.o\
dpspntops.o\
dpspathops.o\
dpssysops.o\
dpswinops.o\
dpsopstack.o\
dpsXops.o\
dpsl2ops.o
PSOPSOBJECTS = \
psclrops.o\
psctrlops.o\
psctxtops.o\
psdataops.o\
psfontops.o\
psgsttops.o\
psioops.o\
psmathops.o\
psmtrxops.o\
psmiscops.o\
pspntops.o\
pspathops.o\
pssysops.o\
pswinops.o\
psopstack.o\
psXops.o\
psl2ops.o
DPSOPSHEADERFILES = \
dpsclrops.h\
dpsctrlops.h\
dpsctxtops.h\
dpsdataops.h\
dpsfontops.h\
dpsgsttops.h\
dpsioops.h\
dpsmathops.h\
dpsmtrxops.h\
dpsmiscops.h\
dpsopstack.h\
dpspntops.h\
dpspathops.h\
dpssysops.h\
dpswinops.h\
dpsXops.h\
dpsl2ops.h
PSOPSHEADERFILES = \
psclrops.h\
psctrlops.h\
psctxtops.h\
psdataops.h\
psfontops.h\
psgsttops.h\
psioops.h\
psmathops.h\
psmtrxops.h\
psmiscops.h\
pspntops.h\
pspathops.h\
pssysops.h\
pswinops.h\
psopstack.h\
psXops.h\
psl2ops.h
DPSOPSCFILES = \
dpsclrops.c\
dpsctrlops.c\
dpsctxtops.c\
dpsdataops.c\
dpsfontops.c\
dpsgsttops.c\
dpsioops.c\
dpsmathops.c\
dpsmtrxops.c\
dpsmiscops.c\
dpsopstack.c\
dpspntops.c\
dpspathops.c\
dpssysops.c\
dpswinops.c\
dpsXops.c\
dpsl2ops.c
PSOPSCFILES = \
psclrops.c\
psctrlops.c\
psctxtops.c\
psdataops.c\
psfontops.c\
psgsttops.c\
psioops.c\
psmathops.c\
psmtrxops.c\
psmiscops.c\
pspntops.c\
pspathops.c\
pssysops.c\
pswinops.c\
psopstack.c\
psXops.c\
psl2ops.c
HEADERS = psops.h dpsops.h
all:: $(HEADERS)
includes:: $(DPSOPSCFILES) $(PSOPSCFILES) $(HEADERS)
$(DPSOPSCFILES) $(PSOPSCFILES): $(PSWRAP)
SRCS = \
${COMMONSOURCEFILES} \
${XSOURCEFILES} \
${XCSDPSSOURCEFILES} \
${DPSOPSCFILES} \
${PSOPSCFILES}
OBJS = \
${COMMONOBJECTFILES} \
${XOBJECTFILES} \
${XCSDPSOBJECTFILES} \
${DPSOPSOBJECTS} \
${PSOPSOBJECTS}
DERIVED_FILES = $(DPSOPSHEADERFILES) $(PSOPSHEADERFILES) \
$(DPSOPSCFILES) $(PSOPSCFILES)
# Inspired by automake 1.11 silent rules - hides details by default
# Run make V=1 to show details
DEFAULT_V = 0
V_CC = $(V_CC_$(V))
V_CC_ = $(V_CC_$(DEFAULT_V))
V_CC_0 = @echo " CC " $@;
V_PSWRAP = $(V_PSWRAP_$(V))
V_PSWRAP_ = $(V_PSWRAP_$(DEFAULT_V))
V_PSWRAP_0 = @echo " PSWRAP" $@;
V_GEN = $(V_GEN_$(V))
V_GEN_ = $(V_GEN_$(DEFAULT_V))
V_GEN_0 = @echo " GEN " $@;
.SUFFIXES: .psw
.psw.c :
$(V_PSWRAP)$(PSWRAP) -a -o $*.c -h $*.h $<
.psw.h :
$(V_PSWRAP)$(PSWRAP) -a -h $*.h $< > /dev/null
.c.o:
$(V_CC)$(CC) $(DPSCFLAGS) $(CFLAGS) $(DPSCPPFLAGS) $(CPPFLAGS) -c $(OUTPUT_OPTION) $<
includes :: $(HEADERS)
depend :: $(DPSOPSCFILES) $(PSOPSCFILES)
psops.h : $(PSOPSHEADERFILES)
$(V_GEN) ${RM} $@ ; \
${CAT} $(PSOPSHEADERFILES) |\
${SED} -e '/^$$/D' -e '/#/D' -e '/^\//D'\
-e '/^ gener/D' -e '/^.\//D' |\
${SORT} > .sort ; \
${AWK} '/;/ {print; printf("\n");}' .sort > .ttt ; \
${CAT} psname.txt header.txt psifdef.txt .ttt psendif.txt > psops.h ; \
${RM} .sort .ttt .attt
dpsops.h : psops.h $(DPSOPSHEADERFILES)
$(V_GEN) ${RM} $@ ; \
${CAT} $(DPSOPSHEADERFILES) |\
${SED} -e '/^$$/D' -e '/#/D' -e '/^\//D'\
-e '/^ gener/D' -e '/^.\//D' |\
${SORT} > .sort ; \
${AWK} '/;/ {print; printf("\n");}' .sort > .ttt ; \
${CAT} dpsname.txt header.txt dpsifdef.txt .ttt dpsendif.txt > dpsops.h ; \
${RM} .sort .ttt .attt
all:: ../include/DPS/psops.h ../include/DPS/dpsops.h
$(OBJS): $(HEADERS) ../include/DPS/psops.h ../include/DPS/dpsops.h
../include/DPS/psops.h: psops.h
-${RM} $@
ln -s ../../libdps/psops.h $@
../include/DPS/dpsops.h: dpsops.h
-${RM} $@
ln -s ../../libdps/dpsops.h $@
all:: $(OBJS) libdps.so.5 libdps.so
MAPFILE = mapfile
libdps.so.5: $(OBJS) $(EXTRASHAREDOBJS) $(MAPFILE)
$(V_CC)$(CC) $(CDEBUGFLAGS) -o $@ -h $@ $(SHLIBLDFLAGS) -M $(MAPFILE) $(OBJS) $(EXTRASHAREDOBJS) $(REQUIREDLIBS)
libdps.so: libdps.so.5
-${RM} libdps.so
ln -s libdps.so.5 libdps.so
install: all
$(INSTALL) libdps.so.5 $(DESTDIR)$(libdir)/libdps.so.5
clean ::
${RM} $(DERIVED_FILES) .sort .ttt .att psops.h dpsops.h *%