summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0dc0216..e2af664 100755
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ KFLAGS+=-DSTANDALONE_ZAPATA
CFLAGS+=-DSTANDALONE_ZAPATA
ROOT_PREFIX=
-INSTALL_PREFIX=
+INSTALL_PREFIX=$(DESTDIR)
CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
@@ -203,9 +203,10 @@ libtonezone.a: $(TZOBJS)
ar rcs libtonezone.a $(TZOBJS)
$(LIBTONEZONE): $(TZOBJS)
- $(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS)
+ $(CC) -shared -Wl,-soname,$(LIBTONEZONE) -lm -o $@ $(TZOBJS)
[ `id -u` = 0 ] && /sbin/ldconfig || :
- ln -sf libtonezone.so.1 libtonezone.so
+ ln -sf $(LIBTONEZONE) libtonezone.so
+ ln -sf $(LIBTONEZONE) libtonezone.so.1
ztcfg.c: ztcfg.h
@@ -301,6 +302,7 @@ install: all devices $(LIBTONEZONE)
install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
+ ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so.1 ; ln -sf $(LIBTONEZONE) libtonezone.so.1 )
[ `id -u` = 0 ] && /sbin/ldconfig || :
if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
cat $(MODCONF).bak | grep -v "alias char-major-250" | \
@@ -343,7 +345,10 @@ config:
install -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
chkconfig --add zaptel; \
fi
- if [ ! -f /etc/sysconfig/zaptel ]; then \
+ if [ -d /etc/default ] && [ ! -f /etc/default/zaptel ]; then \
+ install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
+ fi
+ if [ -d /etc/sysconfig ] && [ ! -f /etc/sysconfig/zaptel ]; then \
install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
fi
if [ -d /etc/sysconfig/network-scripts ]; then \
@@ -370,3 +375,5 @@ clean:
rm -f tor2ee
rm -f fxotune
rm -f core
+ [ -d .tmp_versions ] && rm -rf .tmp_versions
+