1 --- gsm-1.0-pl17/Makefile.orig 2017-06-28 02:24:24.000000000 +0200
2 +++ gsm-1.0-pl17/Makefile 2017-07-16 17:50:06.936841632 +0200
6 CC = gcc -ansi -pedantic
7 -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment
8 +CCFLAGS = $(OPTFLAGS) -DNeedFunctionPrototypes=1 -Wall -Wno-comment
14 ######### Additional libraries needed by $(LD)
18 # Where do you want to install libraries, binaries, a header file
19 # and the manual pages?
21 # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
24 -GSM_INSTALL_ROOT = $(INSTALL_ROOT)
25 +GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
26 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
27 -GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
28 -GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
29 +GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
30 +GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
33 # Where do you want to install the toast binaries and their manpage?
35 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
38 -TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
39 +TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
40 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
41 -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
42 +TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
53 LIBGSM = $(LIB)/libgsm.a
54 +LIBGSMSO= $(LIB)/libgsm.so
57 UNTOAST = $(BIN)/untoast
62 +GSM_SHOBJECTS = $(foreach OBJX,$(GSM_OBJECTS),$(patsubst $(SRC)/%,shared/%,$(OBJX)))
64 TOAST_OBJECTS = $(SRC)/toast.o \
69 GSM_INSTALL_TARGETS = \
70 $(GSM_INSTALL_LIB)/libgsm.a \
71 + $(GSM_INSTALL_LIB)/libgsm.so.1.0.10 \
72 $(GSM_INSTALL_INC)/gsm.h \
73 $(GSM_INSTALL_MAN)/gsm.3 \
74 $(GSM_INSTALL_MAN)/gsm_explode.3 \
80 - @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
81 + $(CC) -c $(CFLAGS) $? -o $@
82 +# @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
86 -all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
87 +all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
90 tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
94 # The basic API: libgsm
95 +#$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
96 +# ld -o $@.1.0.10 -shared -soname libgsm.so.1 $(GSM_OBJECTS)
98 $(LIBGSM): $(LIB) $(GSM_OBJECTS)
99 - -rm $(RMFLAGS) $(LIBGSM)
100 $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
108 + $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $(addprefix $(SRC)/,$(patsubst %.o,%.c,$(@F)))
110 +#libgsm.so.2: shared $(GSM_SHOBJECTS)
111 +# echo $(GSM_SHOBJECTS)
112 +# cd shared; $(CC) -shared -Wl -soname libgsm.so.2 -o libgsm.so.2.0 *.o
114 +$(LIBGSMSO): shared $(GSM_SHOBJECTS)
115 + cd shared; $(CC) -o ../lib/libgsm.so.1.0.10 -shared -Wl,-soname=libgsm.so.1 *.o
118 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
120 $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
121 $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
123 $(UNTOAST): $(BIN) $(TOAST)
124 - -rm $(RMFLAGS) $(UNTOAST)
125 $(LN) $(TOAST) $(UNTOAST)
127 $(TCAT): $(BIN) $(TOAST)
128 - -rm $(RMFLAGS) $(TCAT)
129 $(LN) $(TOAST) $(TCAT)
132 @@ -351,53 +370,47 @@
135 $(TOAST_INSTALL_BIN)/toast: $(TOAST)
140 $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
145 $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
150 $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
155 $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
160 $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
165 $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
170 $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
175 $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
180 $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
185 +$(GSM_INSTALL_LIB)/libgsm.so.1.0.10: $(LIBGSMSO).1.0.10
187 + ln -sf libgsm.so.1.0.10 $(GSM_INSTALL_LIB)/libgsm.so.1
188 + ln -sf libgsm.so.1.0.10 $(GSM_INSTALL_LIB)/libgsm.so