patch-Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. $Id$
  2. --- gsm-1.0-pl10.orig/Makefile Tue Jul 2 16:36:06 1996
  3. +++ gsm-1.0-pl10/Makefile Sat Jan 20 13:23:30 2007
  4. @@ -7,11 +7,13 @@
  5. SASR = -DSASR
  6. ######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
  7. -MULHACK = -DUSE_FLOAT_MUL
  8. +#MULHACK = -DUSE_FLOAT_MUL
  9. +MULHACK =
  10. ######### Define this if your host multiplies floats faster than integers,
  11. ######### e.g. on a SPARCstation.
  12. -FAST = -DFAST
  13. +#FAST = -DFAST
  14. +FAST =
  15. ######### Define together with USE_FLOAT_MUL to enable the GSM library's
  16. ######### approximation option for incorrect, but good-enough results.
  17. @@ -43,8 +45,9 @@ WAV49 =
  18. # CC = /usr/lang/acc
  19. # CCFLAGS = -c -O
  20. -CC = gcc -ansi -pedantic
  21. -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
  22. +CC ?= gcc -ansi -pedantic
  23. +COPTS ?= -O2
  24. +CCFLAGS = -c $(COPTS) -DNeedFunctionPrototypes=1
  25. LD = $(CC)
  26. @@ -78,10 +81,10 @@ INSTALL_ROOT =
  27. # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
  28. # this directory.
  29. -GSM_INSTALL_ROOT = $(INSTALL_ROOT)
  30. +GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
  31. GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
  32. -GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
  33. -GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
  34. +GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
  35. +GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
  36. # Where do you want to install the toast binaries and their manpage?
  37. @@ -89,14 +92,14 @@ GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/ma
  38. # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
  39. # of this directory.
  40. -TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
  41. +TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
  42. TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
  43. -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
  44. +TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
  45. # Other tools
  46. SHELL = /bin/sh
  47. -LN = ln
  48. +LN = ln -s
  49. BASENAME = basename
  50. AR = ar
  51. ARFLAGS = cr
  52. @@ -126,7 +129,7 @@ INC = $(ROOT)/inc
  53. # Flags
  54. -# DEBUG = -DNDEBUG
  55. +DEBUG = -DNDEBUG
  56. ######### Remove -DNDEBUG to enable assertions.
  57. CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
  58. @@ -140,6 +143,7 @@ LFLAGS = $(LDFLAGS) $(LDINC)
  59. # Targets
  60. LIBGSM = $(LIB)/libgsm.a
  61. +LIBGSMSO= $(LIB)/libgsm.so
  62. TOAST = $(BIN)/toast
  63. UNTOAST = $(BIN)/untoast
  64. @@ -258,6 +262,9 @@ STUFF = ChangeLog \
  65. GSM_INSTALL_TARGETS = \
  66. $(GSM_INSTALL_LIB)/libgsm.a \
  67. + $(GSM_INSTALL_LIB)/libgsm.so \
  68. + $(GSM_INSTALL_LIB)/libgsm.so.1 \
  69. + $(GSM_INSTALL_LIB)/libgsm.so.1.0.10 \
  70. $(GSM_INSTALL_INC)/gsm.h \
  71. $(GSM_INSTALL_MAN)/gsm.3 \
  72. $(GSM_INSTALL_MAN)/gsm_explode.3 \
  73. @@ -279,7 +286,7 @@ TOAST_INSTALL_TARGETS = \
  74. # Target rules
  75. -all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
  76. +all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
  77. @-echo $(ROOT): Done.
  78. tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
  79. @@ -299,6 +306,11 @@ install: toastinstall gsminstall
  80. # The basic API: libgsm
  81. +$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
  82. + $(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
  83. + ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
  84. + ln -fs libgsm.so.1.0.10 lib/libgsm.so
  85. +
  86. $(LIBGSM): $(LIB) $(GSM_OBJECTS)
  87. -rm $(RMFLAGS) $(LIBGSM)
  88. $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
  89. @@ -308,15 +320,15 @@ $(LIBGSM): $(LIB) $(GSM_OBJECTS)
  90. # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
  91. $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
  92. - $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
  93. + $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
  94. $(UNTOAST): $(BIN) $(TOAST)
  95. -rm $(RMFLAGS) $(UNTOAST)
  96. - $(LN) $(TOAST) $(UNTOAST)
  97. + $(LN) toast $(UNTOAST)
  98. $(TCAT): $(BIN) $(TOAST)
  99. -rm $(RMFLAGS) $(TCAT)
  100. - $(LN) $(TOAST) $(TCAT)
  101. + $(LN) toast $(TCAT)
  102. # The local bin and lib directories
  103. @@ -332,12 +344,12 @@ $(LIB):
  104. gsminstall:
  105. -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \
  106. - make $(GSM_INSTALL_TARGETS) ; \
  107. + $(MAKE) $(GSM_INSTALL_TARGETS) ; \
  108. fi
  109. toastinstall:
  110. -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \
  111. - make $(TOAST_INSTALL_TARGETS); \
  112. + $(MAKE) $(TOAST_INSTALL_TARGETS); \
  113. fi
  114. gsmuninstall:
  115. @@ -351,54 +363,67 @@ toastuninstall:
  116. fi
  117. $(TOAST_INSTALL_BIN)/toast: $(TOAST)
  118. - -rm $@
  119. - cp $(TOAST) $@
  120. + mkdir -p $(TOAST_INSTALL_BIN)
  121. + cp -f $(TOAST) $@
  122. chmod 755 $@
  123. $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
  124. - -rm $@
  125. - ln $? $@
  126. + mkdir -p $(TOAST_INSTALL_BIN)
  127. + ln -sf $? $@
  128. $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
  129. - -rm $@
  130. - ln $? $@
  131. + mkdir -p $(TOAST_INSTALL_BIN)
  132. + ln -sf $? $@
  133. $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
  134. - -rm $@
  135. - cp $? $@
  136. + mkdir -p $(TOAST_INSTALL_MAN)
  137. + cp -f $? $@
  138. chmod 444 $@
  139. $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
  140. - -rm $@
  141. - cp $? $@
  142. + mkdir -p $(GSM_INSTALL_MAN)
  143. + cp -f $? $@
  144. chmod 444 $@
  145. $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
  146. - -rm $@
  147. - cp $? $@
  148. + mkdir -p $(GSM_INSTALL_MAN)
  149. + cp -f $? $@
  150. chmod 444 $@
  151. $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
  152. - -rm $@
  153. - cp $? $@
  154. + mkdir -p $(GSM_INSTALL_MAN)
  155. + cp -f $? $@
  156. chmod 444 $@
  157. $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
  158. - -rm $@
  159. - cp $? $@
  160. + mkdir -p $(GSM_INSTALL_MAN)
  161. + cp -f $? $@
  162. chmod 444 $@
  163. $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
  164. - -rm $@
  165. - cp $? $@
  166. + mkdir -p $(GSM_INSTALL_INC)
  167. + cp -f $? $@
  168. chmod 444 $@
  169. $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
  170. - -rm $@
  171. - cp $? $@
  172. + mkdir -p $(GSM_INSTALL_LIB)
  173. + cp -f $? $@
  174. chmod 444 $@
  175. +$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSMSO)
  176. + mkdir -p $(GSM_INSTALL_LIB)
  177. + cp -f $? $@
  178. +$(GSM_INSTALL_LIB)/libgsm.so.1: $(LIBGSMSO)
  179. + mkdir -p $(GSM_INSTALL_LIB)
  180. + cp -f $? $@
  181. +
  182. +$(GSM_INSTALL_LIB)/libgsm.so.1.0.10: $(LIBGSMSO)
  183. + mkdir -p $(GSM_INSTALL_LIB)
  184. + cp -f $? $@
  185. + chmod 755 $@
  186. +
  187. +
  188. # Distribution
  189. dist: gsm-1.0.tar.Z
  190. @@ -426,7 +451,9 @@ semi-clean:
  191. clean: semi-clean
  192. -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \
  193. - $(TOAST) $(TCAT) $(UNTOAST) \
  194. + $(LIBGSMSO) $(LIB)/libgsm.so.1.0.10 \
  195. + $(LIB)libgsm.so.1 \
  196. + $(TOAST) $(TCAT) $(UNTOAST) \
  197. $(ROOT)/gsm-1.0.tar.Z