Browse code

- applied Maxim Sobolev <sobomax@FreeBSD.org> makefile patches (slightly adapted for the cvs version)

Andrei Pelinescu-Onciul authored on 24/02/2003 16:46:11
Showing 2 changed files
... ...
@@ -5,6 +5,13 @@
5 5
 # WARNING: requires gmake (GNU Make)
6 6
 #  Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 8), OpenBSD (3.2),
7 7
 #  limited WinNT (cygwin) support
8
+#
9
+#  History:
10
+#  --------
11
+#              created by andrei
12
+#  2003-02-24  make install no longer overwrites ser.cfg  - patch provided
13
+#               by Maxim Sobolev   <sobomax@FreeBSD.org> and 
14
+#                  Tomas Bj´┐Żrklund <tomas@webservices.se>
8 15
 
9 16
 auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
10 17
 
... ...
@@ -158,8 +165,12 @@ $(man-prefix)/$(man-dir)/man5:
158 165
 
159 166
 install-cfg: $(cfg-prefix)/$(cfg-dir)
160 167
 		sed -e "s#/usr/lib/ser/modules/#$(modules-target)#g" \
161
-			< etc/ser.cfg > $(cfg-prefix)/$(cfg-dir)ser.cfg
162
-		chmod 644 $(cfg-prefix)/$(cfg-dir)ser.cfg
168
+			< etc/ser.cfg > $(cfg-prefix)/$(cfg-dir)ser.cfg.default
169
+		chmod 644 $(cfg-prefix)/$(cfg-dir)ser.cfg.default
170
+		if [ ! -e $(cfg-prefix)/$(cfg-dir)ser.cfg ]; then \
171
+			cp -p $(cfg-prefix)/$(cfg-dir)ser.cfg.default \
172
+				$(cfg-prefix)/$(cfg-dir)ser.cfg; \
173
+		fi
163 174
 #		$(INSTALL-CFG) etc/ser.cfg $(cfg-prefix)/$(cfg-dir)
164 175
 
165 176
 install-bin: $(bin-prefix)/$(bin-dir) utils/gen_ha1/gen_ha1
... ...
@@ -2,13 +2,18 @@
2 2
 #
3 3
 # makefile defs (CC, LD,a.s.o)
4 4
 #
5
+# History:
6
+# --------
7
+#              created by andrei
8
+#  2003-02-24  added LOCALBASE, fixed doc-dir for freebsd - patch provided
9
+#              by Maxim Sobolev <sobomax@FreeBSD.org>
5 10
 
6 11
 
7 12
 #version number
8 13
 VERSION = 0
9 14
 PATCHLEVEL = 8
10 15
 SUBLEVEL =   11
11
-EXTRAVERSION = pre6-tcp7-tm
16
+EXTRAVERSION = pre6-tcp8-tm
12 17
 
13 18
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14 19
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -16,7 +21,8 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/  \
16 21
 			-e s/armv4l/arm/)
17 22
 
18 23
  # install location
19
-PREFIX = /usr/local
24
+PREFIX ?= /usr/local
25
+LOCALBASE ?= /usr/local
20 26
 prefix = $(PREFIX)
21 27
 # install path is $(basedir) $(prefix) 
22 28
 # example:
... ...
@@ -39,10 +45,15 @@ modules-dir = lib/ser/modules/
39 45
 ifeq ($(OS), linux)
40 46
 	doc-dir = share/doc/ser/
41 47
 	man-dir = share/man/
48
+else
49
+ifeq ($(OS), freebsd)
50
+	doc-dir = share/doc/ser/
51
+	man-dir = man/
42 52
 else
43 53
 	doc-dir=doc/ser/
44 54
 	man-dir=man/
45 55
 endif
56
+endif
46 57
 ut-prefix = bin/
47 58
 # target dirs for various stuff
48 59
 cfg-target = $(prefix)/$(cfg-dir)