aboutsummaryrefslogtreecommitdiffstats
path: root/archivers/libarc/files/patch-aa
blob: cb6a3074330cc906b8f4e247903915429d08dc62 (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
59
--- Makefile    Tue Jun 13 07:21:19 2000
+++ Makefile    Tue Jun 20 17:44:24 2000
@@ -14,29 +15,43 @@
        url_hqxdecode.o url_qsdecode.o url_news.o url_newsgroup.o url_cgiesc.o \
        arc_mime.o
 
+SOOBJS = $(OBJS:S/.o/.so/g)
+
 # readdir_win.o (for Windows)
 
 LIB=libarc.a
+SOLIB=libarc.so
+SOVERSION?=1
 
-
-all:: $(LIB)
+all:: $(LIB) $(SOLIB) arccat
 
 $(LIB): $(OBJS)
    $(AR) $@ $(OBJS)
    $(RANLIB) $@
 
-arccat: arccat.o $(LIB)
-   $(CC) -o $@ arccat.o $(LIB)
+$(SOLIB): $(SOOBJS)
+   $(CC) -shared -Wl,-soname -Wl,$@.$(SOVERSION) -o $@.$(SOVERSION) $(SOOBJS)
+   $(LN) $@.$(SOVERSION) $@
+
+arccat: arccat.o $(SOLIB)
+   $(CC) $(CFLAGS) -o $@ arccat.o -L. -larc
 
 clean::
-   $(RM) $(LIB) *.o arccat *~ libarc/*~
+   $(RM) $(LIB) $(SOLIB).$(SOVERSION) *.o *.so arccat *~ libarc/*~
 
-install::
-   test -d $(PREFIX)/lib || mkdir -p $(PREFIX)/lib
-   $(INSTALL) -m 444 $(LIB) $(PREFIX)/lib
-   $(RANLIB) $(PREFIX)/lib/$(LIB)
+install:: all
+   $(BSD_INSTALL_PROGRAM) arccat $(PREFIX)/bin
+   $(BSD_INSTALL_PROGRAM) $(SOLIB).$(SOVERSION) $(PREFIX)/lib
+   $(LN) $(PREFIX)/lib/$(SOLIB).$(SOVERSION) $(PREFIX)/lib/$(SOLIB)
+   $(BSD_INSTALL_DATA) $(LIB) $(PREFIX)/lib
    test -d $(PREFIX)/include/libarc || mkdir -p $(PREFIX)/include/libarc
-   $(INSTALL) -m 444 libarc/url.h $(PREFIX)/include/libarc
-   $(INSTALL) -m 444 libarc/arc.h $(PREFIX)/include/libarc
-   $(INSTALL) -m 444 libarc/mblock.h $(PREFIX)/include/libarc
-   $(INSTALL) -m 444 libarc/memb.h $(PREFIX)/include/libarc
+   $(BSD_INSTALL_DATA) libarc/url.h $(PREFIX)/include/libarc
+   $(BSD_INSTALL_DATA) libarc/arc.h $(PREFIX)/include/libarc
+   $(BSD_INSTALL_DATA) libarc/mblock.h $(PREFIX)/include/libarc
+   $(BSD_INSTALL_DATA) libarc/memb.h $(PREFIX)/include/libarc
+   $(BSD_INSTALL_DATA) unlzh.h zip.h $(PREFIX)/include/libarc
+
+.SUFFIXES: .so .c
+
+.c.so:
+   $(CC) $(CFLAGS) -fPIC -fpic -DPIC -c $(.IMPSRC) -o $(.TARGET)