288 lines
7.6 KiB
Plaintext
288 lines
7.6 KiB
Plaintext
$OpenBSD: patch-Makefile,v 1.5 2005/12/23 16:59:13 espie Exp $
|
|
--- Makefile.orig Tue Jul 2 16:36:06 1996
|
|
+++ Makefile Thu Dec 22 13:46:49 2005
|
|
@@ -7,11 +7,13 @@
|
|
SASR = -DSASR
|
|
######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
|
|
|
|
-MULHACK = -DUSE_FLOAT_MUL
|
|
+#MULHACK = -DUSE_FLOAT_MUL # Don't define it for FreeBSD, cause SIGFPE
|
|
+MULHACK =
|
|
######### Define this if your host multiplies floats faster than integers,
|
|
######### e.g. on a SPARCstation.
|
|
|
|
-FAST = -DFAST
|
|
+#FAST = -DFAST
|
|
+FAST =
|
|
######### Define together with USE_FLOAT_MUL to enable the GSM library's
|
|
######### approximation option for incorrect, but good-enough results.
|
|
|
|
@@ -44,7 +46,7 @@ WAV49 =
|
|
# CCFLAGS = -c -O
|
|
|
|
CC = gcc -ansi -pedantic
|
|
-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
|
|
+CCFLAGS = -c -DNeedFunctionPrototypes=1
|
|
|
|
LD = $(CC)
|
|
|
|
@@ -80,7 +82,7 @@ INSTALL_ROOT =
|
|
|
|
GSM_INSTALL_ROOT = $(INSTALL_ROOT)
|
|
GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
|
|
-GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
|
|
+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
|
|
GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
|
|
|
|
|
|
@@ -106,7 +108,10 @@ COMPRESS = compress
|
|
COMPRESSFLAGS =
|
|
# RANLIB = true
|
|
RANLIB = ranlib
|
|
+RM = rm -f
|
|
|
|
+PICFLAG = -fpic
|
|
+
|
|
#
|
|
# You shouldn't have to configure below this line if you're porting.
|
|
#
|
|
@@ -136,11 +141,21 @@ CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(M
|
|
LFLAGS = $(LDFLAGS) $(LDINC)
|
|
######### It's $(LD) $(LFLAGS)
|
|
|
|
+.SUFFIXES: .o .so
|
|
|
|
# Targets
|
|
|
|
LIBGSM = $(LIB)/libgsm.a
|
|
+LIBgsm_VERSION= 1.0
|
|
|
|
+.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes"
|
|
+LIBGSMSO =
|
|
+INSTALLED_LIBGSMSO =
|
|
+.else
|
|
+LIBGSMSO = $(LIB)/libgsm.so.${LIBgsm_VERSION}
|
|
+INSTALLED_LIBGSMSO = $(GSM_INSTALL_LIB)/libgsm.so.${LIBgsm_VERSION}
|
|
+.endif
|
|
+
|
|
TOAST = $(BIN)/toast
|
|
UNTOAST = $(BIN)/untoast
|
|
TCAT = $(BIN)/tcat
|
|
@@ -258,6 +273,7 @@ STUFF = ChangeLog \
|
|
|
|
GSM_INSTALL_TARGETS = \
|
|
$(GSM_INSTALL_LIB)/libgsm.a \
|
|
+ $(INSTALLED_LIBGSMSO) \
|
|
$(GSM_INSTALL_INC)/gsm.h \
|
|
$(GSM_INSTALL_MAN)/gsm.3 \
|
|
$(GSM_INSTALL_MAN)/gsm_explode.3 \
|
|
@@ -277,9 +293,12 @@ TOAST_INSTALL_TARGETS = \
|
|
$(CC) $(CFLAGS) $?
|
|
@-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
|
|
|
|
+.c.so:
|
|
+ $(CC) $(CFLAGS) $(PICFLAG) -DPIC $? -o $@
|
|
+
|
|
# Target rules
|
|
|
|
-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
|
|
+all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
|
|
@-echo $(ROOT): Done.
|
|
|
|
tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
|
|
@@ -299,8 +318,11 @@ install: toastinstall gsminstall
|
|
|
|
# The basic API: libgsm
|
|
|
|
+$(LIBGSMSO): $(LIB) $(GSM_OBJECTS:.o=.so)
|
|
+ $(CC) -shared $(PICFLAG) -o $@ $(GSM_OBJECTS:.o=.so)
|
|
+
|
|
$(LIBGSM): $(LIB) $(GSM_OBJECTS)
|
|
- -rm $(RMFLAGS) $(LIBGSM)
|
|
+ $(RM) $(RMFLAGS) $(LIBGSM)
|
|
$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
|
|
$(RANLIB) $(LIBGSM)
|
|
|
|
@@ -308,14 +330,14 @@ $(LIBGSM): $(LIB) $(GSM_OBJECTS)
|
|
# Toast, Untoast and Tcat -- the compress-like frontends to gsm.
|
|
|
|
$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
|
|
+ $(CC) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) -lgsm $(LDLIB)
|
|
|
|
$(UNTOAST): $(BIN) $(TOAST)
|
|
- -rm $(RMFLAGS) $(UNTOAST)
|
|
+ $(RM) $(RMFLAGS) $(UNTOAST)
|
|
$(LN) $(TOAST) $(UNTOAST)
|
|
|
|
$(TCAT): $(BIN) $(TOAST)
|
|
- -rm $(RMFLAGS) $(TCAT)
|
|
+ $(RM) $(RMFLAGS) $(TCAT)
|
|
$(LN) $(TOAST) $(TCAT)
|
|
|
|
|
|
@@ -342,63 +364,51 @@ toastinstall:
|
|
|
|
gsmuninstall:
|
|
-if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \
|
|
- rm $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \
|
|
+ $(RM) $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \
|
|
fi
|
|
|
|
toastuninstall:
|
|
-if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \
|
|
- rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \
|
|
+ $(RM) $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \
|
|
fi
|
|
|
|
$(TOAST_INSTALL_BIN)/toast: $(TOAST)
|
|
- -rm $@
|
|
- cp $(TOAST) $@
|
|
- chmod 755 $@
|
|
+ ${BSD_INSTALL_PROGRAM} $(TOAST) $@
|
|
|
|
$(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
|
|
- -rm $@
|
|
- ln $? $@
|
|
+ cd $(TOAST_INSTALL_BIN) && ln -sf toast untoast
|
|
|
|
$(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
|
|
- -rm $@
|
|
- ln $? $@
|
|
+ cd $(TOAST_INSTALL_BIN) && ln -sf toast tcat
|
|
|
|
$(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
+ cd $(TOAST_INSTALL_MAN) && ln -sf toast.1 untoast.1 && \
|
|
+ ln -sf toast.1 tcat.1
|
|
|
|
$(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
|
|
$(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
|
|
$(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
|
|
$(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
|
|
$(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_DATA} $? $@
|
|
|
|
$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
|
|
- -rm $@
|
|
- cp $? $@
|
|
- chmod 444 $@
|
|
+ ${BSD_INSTALL_DATA} $? $@
|
|
+ $(RANLIB) $@
|
|
|
|
+$(INSTALLED_LIBGSMSO): $(LIBGSMSO)
|
|
+ ${BSD_INSTALL_MAN} $? $@
|
|
|
|
+
|
|
# Distribution
|
|
|
|
dist: gsm-1.0.tar.Z
|
|
@@ -416,16 +426,16 @@ uninstall: toastuninstall gsmuninstall
|
|
@-echo uninstall: Done.
|
|
|
|
semi-clean:
|
|
- -rm $(RMFLAGS) */*.o \
|
|
+ $(RM) $(RMFLAGS) */*.o \
|
|
$(TST)/lin2cod $(TST)/lin2txt \
|
|
$(TST)/cod2lin $(TST)/cod2txt \
|
|
$(TST)/gsm2cod \
|
|
$(TST)/*.*.*
|
|
-$(FIND) . \( -name core -o -name foo \) \
|
|
- -print | xargs rm $(RMFLAGS)
|
|
+ -print | xargs $(RM) $(RMFLAGS)
|
|
|
|
clean: semi-clean
|
|
- -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \
|
|
+ $(RM) $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \
|
|
$(TOAST) $(TCAT) $(UNTOAST) \
|
|
$(ROOT)/gsm-1.0.tar.Z
|
|
|
|
@@ -434,29 +444,29 @@ clean: semi-clean
|
|
# but aren't generally needed to port this.
|
|
|
|
$(TLS)/sweet: $(TLS)/sweet.o $(TLS)/taste.o
|
|
- $(LD) $(LFLAGS) -o $(TLS)/sweet \
|
|
+ $(CC) $(LFLAGS) -o $(TLS)/sweet \
|
|
$(TLS)/sweet.o $(TLS)/taste.o $(LDLIB)
|
|
|
|
$(TLS)/bitter: $(TLS)/bitter.o $(TLS)/taste.o
|
|
- $(LD) $(LFLAGS) -o $(TLS)/bitter \
|
|
+ $(CC) $(LFLAGS) -o $(TLS)/bitter \
|
|
$(TLS)/bitter.o $(TLS)/taste.o $(LDLIB)
|
|
|
|
# A version of the same family that Jeff Chilton used to implement
|
|
# the WAV #49 GSM format.
|
|
|
|
$(TLS)/ginger: $(TLS)/ginger.o $(TLS)/taste.o
|
|
- $(LD) $(LFLAGS) -o $(TLS)/ginger \
|
|
+ $(CC) $(LFLAGS) -o $(TLS)/ginger \
|
|
$(TLS)/ginger.o $(TLS)/taste.o $(LDLIB)
|
|
|
|
$(TLS)/sour: $(TLS)/sour.o $(TLS)/taste.o
|
|
- $(LD) $(LFLAGS) -o $(TLS)/sour \
|
|
+ $(CC) $(LFLAGS) -o $(TLS)/sour \
|
|
$(TLS)/sour.o $(TLS)/taste.o $(LDLIB)
|
|
|
|
# Run $(ADDTST)/add < $(ADDTST)/add_test.dta to make sure the
|
|
# basic arithmetic functions work as intended.
|
|
|
|
$(ADDTST)/add: $(ADDTST)/add_test.o
|
|
- $(LD) $(LFLAGS) -o $(ADDTST)/add $(ADDTST)/add_test.o $(LDLIB)
|
|
+ $(CC) $(LFLAGS) -o $(ADDTST)/add $(ADDTST)/add_test.o $(LDLIB)
|
|
|
|
|
|
# Various conversion programs between linear, text, .gsm and the code
|
|
@@ -474,21 +484,21 @@ $(TST)/test-result: $(TST)/lin2cod $(TST
|
|
( cd $(TST); ./run )
|
|
|
|
$(TST)/lin2txt: $(TST)/lin2txt.o $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TST)/lin2txt \
|
|
+ $(CC) $(LFLAGS) -o $(TST)/lin2txt \
|
|
$(TST)/lin2txt.o $(LIBGSM) $(LDLIB)
|
|
|
|
$(TST)/lin2cod: $(TST)/lin2cod.o $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TST)/lin2cod \
|
|
+ $(CC) $(LFLAGS) -o $(TST)/lin2cod \
|
|
$(TST)/lin2cod.o $(LIBGSM) $(LDLIB)
|
|
|
|
$(TST)/gsm2cod: $(TST)/gsm2cod.o $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TST)/gsm2cod \
|
|
+ $(CC) $(LFLAGS) -o $(TST)/gsm2cod \
|
|
$(TST)/gsm2cod.o $(LIBGSM) $(LDLIB)
|
|
|
|
$(TST)/cod2txt: $(TST)/cod2txt.o $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TST)/cod2txt \
|
|
+ $(CC) $(LFLAGS) -o $(TST)/cod2txt \
|
|
$(TST)/cod2txt.o $(LIBGSM) $(LDLIB)
|
|
|
|
$(TST)/cod2lin: $(TST)/cod2lin.o $(LIBGSM)
|
|
- $(LD) $(LFLAGS) -o $(TST)/cod2lin \
|
|
+ $(CC) $(LFLAGS) -o $(TST)/cod2lin \
|
|
$(TST)/cod2lin.o $(LIBGSM) $(LDLIB)
|