File: Makefile

package info (click to toggle)
twin 0.4.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,804 kB
  • ctags: 23,904
  • sloc: ansic: 61,860; cpp: 1,023; makefile: 777; sh: 552; lex: 302; yacc: 231
file content (118 lines) | stat: -rw-r--r-- 2,882 bytes parent folder | download | duplicates (2)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Makefile for libTw, the library that talks to Twin
#
TOPDIR=../..
SUBDIRS=

-include $(TOPDIR)/makeautoconf

LD_FLAGS+=$(LD_LIBSOCKET)

all: everything

VERSION=3.0.3
SO_VER=3

BINS=libTw.so.$(VERSION)
ARLIBS=libTw.a



OBJS_libTw.so.$(VERSION)=libTw.o avl.o md5.o missing.o
OBJS_libTw.a=libTw_u.o avl_u.o md5_u.o missing_u.o

CC_FLAGS_libTw.o+=-fPIC -D_REENTRANT
CC_FLAGS_avl.o+=-fPIC -D_REENTRANT
CC_FLAGS_md5.o+=-fPIC -D_REENTRANT
CC_FLAGS_missing.o+=-fPIC -D_REENTRANT
CC_FLAGS_libTw_u.o+=-D_REENTRANT
CC_FLAGS_avl_u.o+=-D_REENTRANT
CC_FLAGS_md5_u.o+=-D_REENTRANT
CC_FLAGS_missing_u.o+=-D_REENTRANT

LD_FLAGS_libTw.so.$(VERSION)=$(LD_FLAGS_SOLIB)libTw.so.$(SO_VER)

-include $(TOPDIR)/conf/conf.current
-include .modules
-include .depend

ifneq ($(CONF_SOCKET),n)
  # do not link against libpthread: let client programs specify it explicitly
  # if they want to use threads, so that if they don't,
  # fallback, do-nothing functions will be picked from libc (if they exist)
  # avoiding overhead.
  #
  ifeq ($(CONF_SOCKET_PTHREADS),y)
    LD_FLAGS_libTw.so.$(VERSION)+=$(LD_LIBPTHREAD_WEAK)
  endif
  everything: lib
  install: install-real
  ifeq ($(CONF_SOCKET_GZ),y)
    LD_FLAGS_libTw.so.$(VERSION)+=-lz
  endif
else
  everything: warn
  install: warn
  warn:
	@$(ECHO) ; \
	 $(ECHO) "You disabled \"Support remote socket connections\"," ; \
	 $(ECHO) "so the library libTw.so will NOT be compiled!" ; \
	 $(ECHO)
endif


#
# include the do-everything file.
# Must correctly set all CC_FLAGS* and LD_FLAGS* before including this!
#
include $(TOPDIR)/makerules



#
# handy targets
#
ifeq ($(CONF__SHLIBS),y)
  lib: $(ARLIBS) $(BINS) links
else
  lib: $(ARLIBS)
	@$(ECHO) ; \
	 $(ECHO) "You disabled \"Enable shared libraries (ELF)\"," ; \
	 $(ECHO) "so only the static library libTw.a will be compiled!" ; \
	 $(ECHO)
endif

links: libTw.so.$(SO_VER) libTw.so

libTw.so.$(SO_VER):
	$(LN) libTw.so.$(VERSION) libTw.so.$(SO_VER)

libTw.so:
	$(LN) libTw.so.$(SO_VER) libTw.so

libTw_u.c avl_u.c md5.c md5_u.c missing.c missing_u.c:
	$(LN) libTw.c libTw_u.c && \
	$(LN) avl.c avl_u.c && \
	$(LN) $(TOPDIR)/server/md5.c md5.c && \
	$(LN) $(TOPDIR)/server/md5.c md5_u.c && \
	$(LN) $(TOPDIR)/server/missing.c missing.c && \
	$(LN) $(TOPDIR)/server/missing.c missing_u.c

autogen: paranoiam4.h libTw1m4.h libTw2m4.h

install-headers:
	$(INSTALL) -d $(DESTDIR)$(includedir)/Tw && \
	$(INSTALL-TXT) $(TOPDIR)/include/Tw/*.h $(DESTDIR)$(includedir)/Tw

install-real: install-headers
	$(INSTALL) -d $(DESTDIR)$(libdir) && \
	$(INSTALL-TXT) $(ARLIBS) $(DESTDIR)$(libdir) && \
	if [ -f libTw.so.$(VERSION) ]; then \
		$(INSTALL) libTw.so.$(VERSION) $(DESTDIR)$(libdir) && \
		$(LN) libTw.so.$(VERSION) $(DESTDIR)$(libdir)/libTw.so.$(SO_VER) && \
		$(LN) libTw.so.$(SO_VER)  $(DESTDIR)$(libdir)/libTw.so; \
	fi

clean:
	rm -f .*.flags .*.link .*.arlib libTw.so* libTw.a $(_ALLOBJS)