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 158
 
159 159
 install-cfg: $(cfg-prefix)/$(cfg-dir)
160 160
 		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
161
+			< etc/ser.cfg > $(cfg-prefix)/$(cfg-dir)ser.cfg.default
162
+		chmod 644 $(cfg-prefix)/$(cfg-dir)ser.cfg.default
163
+		if [ ! -e $(cfg-prefix)/$(cfg-dir)ser.cfg ]; then \
164
+			cp -p $(cfg-prefix)/$(cfg-dir)ser.cfg.default \
165
+				$(cfg-prefix)/$(cfg-dir)ser.cfg; \
166
+		fi
163 167
 #		$(INSTALL-CFG) etc/ser.cfg $(cfg-prefix)/$(cfg-dir)
164 168
 
165 169
 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 16
 			-e s/armv4l/arm/)
17 17
 
18 18
  # install location
19
-PREFIX = /usr/local
19
+PREFIX ?= /usr/local
20
+LOCALBASE ?= /usr/local
20 21
 prefix = $(PREFIX)
21 22
 # install path is $(basedir) $(prefix) 
22 23
 # example:
... ...
@@ -40,9 +46,14 @@ ifeq ($(OS), linux)
40 40
 	doc-dir = share/doc/ser/
41 41
 	man-dir = share/man/
42 42
 else
43
+ifeq ($(OS), freebsd)
44
+	doc-dir = share/doc/ser/
45
+	man-dir = man/
46
+else
43 47
 	doc-dir=doc/ser/
44 48
 	man-dir=man/
45 49
 endif
50
+endif
46 51
 ut-prefix = bin/
47 52
 # target dirs for various stuff
48 53
 cfg-target = $(prefix)/$(cfg-dir)