summaryrefslogtreecommitdiff
path: root/devel/libmba/files/patch-Makefile
blob: 935233dc582cd6eeffcde72eafa013e00c8d2cb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- Makefile.orig	Sun Nov 17 10:37:18 2002
+++ Makefile	Tue Nov 19 07:54:45 2002
@@ -1,17 +1,17 @@
-prefix     = /usr/local
+prefix     = ${PREFIX}
 includedir = $(prefix)/include
 libdir     = $(prefix)/lib
 mandir     = $(prefix)/man
-CC         = gcc
+CC         ?= gcc
 LIBNAME    = mba
-MAJVERSION = 0.4
-MINVERSION = 0.4.5
+MAJVERSION = ${SHLIB_MAJOR}
+MINVERSION = ${SHLIB_MAJOR}
 ARNAME     = lib$(LIBNAME).a
 SONAME     = lib$(LIBNAME).so.$(MINVERSION)
 SOVERSION  = lib$(LIBNAME).so.$(MAJVERSION)
 DISTRO     = lib$(LIBNAME)-$(MINVERSION)
 RPM_OPT_FLAGS = -O2
-CFLAGS     = -Wall -W -DMSGNO -I$(includedir) -L$(libdir) $(RPM_OPT_FLAGS)
+CFLAGS     += -DMSGNO -I${LOCALBASE}/include
 #CFLAGS     = -Wall -W -DMSGNO -I$(includedir) -L$(libdir) $(RPM_OPT_FLAGS) -ansi -pedantic -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wtraditional -Wconversion -Waggregate-return -Wno-parentheses
 OBJS       = src/stack.o src/linkedlist.o src/hashmap.o src/profile.o src/hexdump.o src/msgno.o src/domnode.o src/mbs.o src/cfg.o
 HDRS       = src/msgno.h src/stack.h src/linkedlist.h src/hashmap.h src/hexdump.h src/domnode.h src/profile.h src/mbs.h src/cfg.h
@@ -20,7 +20,7 @@
 all: $(ARNAME)($(OBJS)) $(SONAME)
 
 $(SONAME): $(ARNAME)($(OBJS)) $(OBJS)
-	$(CC) -shared $(OBJS) -L$(libdir) -lc -lexpat -Wl,-h,$(SOVERSION) -o $(SONAME)
+	$(CC) -shared $(OBJS) -L${LOCALBASE}/lib -lexpat -Wl,-h,$(SOVERSION) -o $(SONAME)
 
 .c.a:
 	$(CC) $(CFLAGS) -c $< -o $*.o
@@ -31,15 +31,14 @@
 	$(CC) $(CFLAGS) -fpic -c -o $*.o $<
 
 install: $(SONAME)
-	install -d $(libdir)
-	install -d $(includedir)/mba
-	install -d $(mandir)/man3
-	install -m 644 $(ARNAME) $(libdir)
-	install -m 755 $(SONAME) $(libdir)
-	cd $(libdir) && ln -sf $(SONAME) $(SOVERSION) && ln -sf $(SONAME) lib$(LIBNAME).so
-	install -m 444 $(HDRS) $(includedir)/mba
-	-install -m 444 docs/man/*.3m.gz $(mandir)/man3
-	-/sbin/ldconfig $(libdir)
+	mkdir -p $(libdir)
+	mkdir -p $(includedir)/mba
+	mkdir -p $(mandir)/man3
+	${BSD_INSTALL_DATA} $(ARNAME) $(libdir)
+	${BSD_INSTALL_DATA} $(SONAME) $(libdir)
+	cd $(libdir) && ln -sf $(SONAME) lib$(LIBNAME).so
+	${BSD_INSTALL_DATA} $(HDRS) $(includedir)/mba
+	${BSD_INSTALL_DATA} docs/man/*.3m.gz $(mandir)/man3
 
 zip:
 	cd .. && zip -lr $(DISTRO)/.$(DISTRO).zip $(DISTRO) -x $(DISTRO)/.* $(DISTRO)/docs/man/* $(DISTRO)/tests/data* $(DISTRO)/libmba.lib $(DISTRO)/libmba.dll $(DISTRO)/libmba_s.lib