1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
# ########################################################################
#
# Makefile for libY2
#
# Rules:
#
# all -- builds program.
# install -- install program.
# clean -- remove object and other work files.
#
# If no arguments are givin, the program is built by default.
#
# ########################################################################
# Install Options:
#
PREFIX = /usr
# ########################################################################
# Library Name and Version:
#
# Note, do not change the *major* version number. That would imply that
# the entire Y protocol has changed.
#
LIBPFX = libY2
LIBVER = 14
# ########################################################################
# Compiler Flags:
#
# These are definations to enable or disable certain compile time
# options. Omitting a defination turns that option off.
#
# Each argument is of the format -D<option> where <option> is
# one of the following:
#
# * None available *
#
# Other arguments include:
#
# -O# Specifies the optimization level the
# compiler is to compile at. This (attempts)
# to improve the efficiency of the generated
# program when it runs. Available values for
# # are from 0 to 2 (some compilers allow
# higher values). When in doubt, set # to 2.
#
# -g Compile with debugging information,
# this is useful for determining why this
# program (if it did) crash. However this
# may hinder performance, so don't use
# this option unless you are attempting
# to debug the program.
#
# -shared Compile this program as a shared library.
#
CFLAGS = -Wall -O6 -fomit-frame-pointer -funroll-loops \
-finline-functions -ffast-math -fPIC
#CFLAGS = -Wall -O2 -g
#CFLAGS = -Wall -O6 -fomit-frame-pointer -funroll-loops \
# -finline-functions -ffast-math -march=i586
#CPPFLAGS = -D__cplusplus -Dc_plusplus
# ########################################################################
# Dependant Libraries:
#
# These are dynamic (sometimes called shared) libraries that this
# program is to be `linked' to.
#
# Each argument is of the format -l<name> where <name> is the name
# of the library. You may have to add one or more -l<name> arguments
# to the LIB line depending on what you have set in the CFLAGS line
# farther above.
#
LIBS = -lm
# Library Directories:
#
# All libraries are looked for in the directories specified below.
#
# Each argument is of the format -L<dir> where <dir> is the full
# path to the directory.
#
LIB_DIRS =
# Header File Directories:
#
# Required header files that are not in the standard locations are
# searched for in the directories specified below.
#
# Each argument is of the format -I<dir> where <dir> is the full
# path to the directory.
#
INC =
INC_DIRS =
# ########################################################################
# Program Source and Header Files:
#
include Makefile.srclist
CC = gcc
CPP = gcc
# ########################################################################
# Utilities:
#
LS = ls
LSFLAGS = -a -l
RM = rm
RMFLAGS = -f
COPY = cp
COPYFLAGS = -i -v
MKDIR = mkdir
MKDIRFLAGS = -p
LINK = ln
LINKFLAGS = -sf
LDCONFIG = ldconfig
# ########################################################################
# Build Rules:
#
LIB = $(LIBPFX).so.$(LIBVER)
LIB_STATIC = $(LIBPFX).a
OBJ_C = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
+$(CC) -c $*.c $(INC_DIRS) $(CFLAGS)
.cpp.o:
+$(CPP) -x c -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS)
$(LIB): $(OBJ_C) $(OBJ_CPP)
$(CPP) $(OBJ_C) $(OBJ_CPP) -Wl,-soname=$(LIBPFX).so.$(LIBVER) -shared -o $(LIB) $(LIBS) $(LIB_DIRS)
$(LINK) -s $(LIBPFX).so.$(LIBVER) $(LIBPFX).so
$(LIB_STATIC): $(OBJ_C) $(OBJ_CPP)
ar r $(LIB_STATIC) $(OBJ_C) $(OBJ_CPP)
all: $(LIB_STATIC) $(LIB)
# ########################################################################
# Install Rules:
#
INSTALL = install
INSTBINFLAGS = -m 0755 -s
INSTUIDFLAGS = -m 4755
INSTLIBFLAGS = -m 0755 -s
INSTINCFLAGS = -m 0644
INSTMANFLAGS = -m 0644
INSTCFGFLAGS = -m 0644
INSTDATFLAGS = -m 0644
YLIB_DIR = $(PREFIX)/lib
YINC_DIR = $(PREFIX)/include/Y2
YMAN_DIR = $(PREFIX)/man/man3
install_lib:
$(MKDIR) $(MKDIRFLAGS) $(YLIB_DIR)
$(INSTALL) $(INSTLIBFLAGS) $(LIB) $(YLIB_DIR)
$(LINK) $(LINKFLAGS) $(LIB) $(YLIB_DIR)/$(LIBPFX).so
install:
$(MKDIR) $(MKDIRFLAGS) $(YLIB_DIR)
$(INSTALL) $(INSTLIBFLAGS) $(LIB) $(YLIB_DIR)
$(LINK) $(LINKFLAGS) $(LIB) $(YLIB_DIR)/$(LIBPFX).so
$(MKDIR) $(MKDIRFLAGS) $(YINC_DIR)
$(INSTALL) $(INSTINCFLAGS) ../include/Y2/Y.h $(YINC_DIR)
$(INSTALL) $(INSTINCFLAGS) ../include/Y2/Ylib.h $(YINC_DIR)
$(INSTALL) $(INSTINCFLAGS) ../include/Y2/Yclientnet.h $(YINC_DIR)
$(INSTALL) $(INSTINCFLAGS) ../include/Y2/Ymixercodes.h $(YINC_DIR)
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YAddHost.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YAudioCDTrackStruct.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YCalculateCycle.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YChangeAudioModePreset.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YCloseConnection.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YDestroyPlaySoundObject.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEjectAudioCD.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEvent.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventAudioCDStats.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventAudioChange.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventAudioStats.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventClientMessage.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventCycleChange.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventDisconnect.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventHost.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventMixer.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventServerStats.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventShutdown.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventSoundKill.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventSoundObjectAttributes.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventSoundPlay.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventSync.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YEventYSHMSound.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YFreeAudioCDTracksList.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YFreeAudioModesList.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetAudioCDTracks.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetAudioModes.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetAudioStats.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetMixerChannel.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetMixerChannelQuad.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetNextEvent.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetPlaySoundObjectValues.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetServerStats.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YGetSoundObjectAttributes.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YIPUnion.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YIntro.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YMatchAudioModeValues.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YOpenConnection.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YPlayAudioCDTrack.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YPutBackEvent.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YRemoveHost.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSHMCloseSound.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSHMOpenSound.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSendClientMessage.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSetAudioModeValues.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSetCycle.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSetMixerChannel.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSetMixerChannelQuad.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSetPlaySoundObjectValues.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YShutdownServer.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YStartPlaySoundObject.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YStartPlaySoundObjectSimple.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YStopAudioCD.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YSyncAll.3
@$(RM) $(RMFLAGS) $(YMAN_DIR)/YVolumeStruct.3
$(MKDIR) $(MKDIRFLAGS) $(YMAN_DIR)
$(INSTALL) $(INSTMANFLAGS) man/* $(YMAN_DIR)
-$(LDCONFIG)
@echo "-------------------------------------------------------------------------"
@echo "Library $(LIB) installed in:"
@echo " "
@echo " $(YLIB_DIR)"
@echo " "
@echo "Header files are installed in:"
@echo " "
@echo " $(YINC_DIR)"
@echo " "
@echo "Manual pages are installed in:"
@echo " "
@echo " $(YMAN_DIR)"
@echo " "
@echo "To link your programs to this library add -lY2 to the compiler"
@echo "command."
@echo " "
@echo "You may also need to recompile some programs which are linked"
@echo "to this program in case of protocol value changes. Modification"
@echo "to their code is unnessasary if the major version number matches."
@echo " "
# ########################################################################
# Maintainance and Misc Rules:
#
clean:
$(RM) $(RMFLAGS) a.out core *.o $(LIB) $(LIBPFX).so *.a
# ########################################################################
|