File: make.rules.in

package info (click to toggle)
evms 2.5.2-1.sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,248 kB
  • ctags: 15,488
  • sloc: ansic: 201,340; perl: 12,421; sh: 4,262; makefile: 1,516; yacc: 316; sed: 16
file content (141 lines) | stat: -rw-r--r-- 4,318 bytes parent folder | download
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
SHELL		= /bin/sh
VPATH		= @srcdir@
top_builddir	= $(top_srcdir)

# Programs
@SET_MAKE@
CC		= @CC@
CPP		= @CPP@
LN_S		= @LN_S@
INSTALL		= @INSTALL@
MKINSTALLDIRS	= $(top_srcdir)/autoconf/mkinstalldirs.sh

# Default version number. Each individual directory is free to set their
# own version (if they wish).
MAJOR_VERSION	= 2
MINOR_VERSION	= 5
PATCH_LEVEL	= 2

DATE		:= $(shell date +%D)
VERSION		= $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)$(EXTRA_VERSION)

# Compiler flags
CFLAGS		= @CFLAGS@
LDFLAGS		= @LDFLAGS@
EVMS_CFLAGS	= -Wall -fPIC -fno-strict-aliasing
EVMS_CPPFLAGS	= -I$(top_srcdir)/include -I$(top_srcdir)/intl
EVMS_DEFS	= $(EVMS_DEBUG)				\
		  $(NLS_DEFS)				\
		  -DMAJOR_VERSION=$(MAJOR_VERSION)	\
		  -DMINOR_VERSION=$(MINOR_VERSION)	\
		  -DPATCH_LEVEL=$(PATCH_LEVEL)		\
		  -DVERSION=\"$(VERSION)\"		\
		  -DDATE=\"$(DATE)\"

EVMS_LDFLAGS	= $(LDFLAGS)
EVMS_LIBS	= @LIBINTL@ $(EFENCE_LIBS)
NLS_DEFS	= $(ENABLE_NLS) -DPACKAGE=\"@PACKAGE@\" -DLOCALEDIR=\"$(localedir)\"

PTHREAD_LIBS	= @PTHREAD_LIBS@
UUID_LIBS	= @UUID_LIBS@
NCURSES_LIBS	= @NCURSES_LIBS@
NCURSES_CPPFLAGS= @NCURSES_CPPFLAGS@
PANEL_LIBS	= @PANEL_LIBS@
READLINE_LIBS	= @READLINE_LIBS@
READLINE_DEFS	= @READLINE_DEFS@
MATH_LIBS	= @MATH_LIBS@
GLIB_LIBS	= @GLIB_LIBS@
GLIB_CPPFLAGS	= @GLIB_CPPFLAGS@
GTK_LIBS	= @GTK_LIBS@
GTK_CPPFLAGS	= @GTK_CPPFLAGS@
HA_LIBS		= @HA_LIBS@
HA_CPPFLAGS	= @HA_CPPFLAGS@
HA_RESOURCEDIR	= @HA_RESOURCEDIR@
HA_MAJOR	= @HA_MAJOR@
HA_MINOR	= @HA_MINOR@
HA_PATCH	= @HA_PATCH@
HA_GS_R_LIBS	= @HA_GS_R_LIBS@
DEVMAPPER_LIBS	= @DEVMAPPER_LIBS@
EFENCE_LIBS	= @EFENCE_LIBS@
EVMS_DEBUG	= @EVMS_DEBUG@
ENABLE_NLS	= @ENABLE_NLS@

# Install directories
# By default, we want prefix to be "/usr", and exec_prefix to be "/". This
# will install the libraries in /lib, the plugins in /lib/evms, the UIs in
# /sbin, the headers in /usr/include/evms, and the man pages in /usr/man.
# However, autoconf only seems to let us set the default for prefix. So to
# make it all work correctly with the configure script, we have to play some
# games here. In the configure script, we set the prefix default to blank. If
# it is still blank here, we can assume the user has not specified a prefix,
# and we can set them up as we wish.
prefix		= @prefix@

ifeq ($(strip $(prefix)),)
	prefix		= /usr
	exec_prefix	=
else
	exec_prefix	= @exec_prefix@
endif

sbindir		= @sbindir@
libdir		= @libdir@
mandir		= @mandir@
includedir	= @includedir@
localedir	= @datadir@/locale
evmsheadersdir	= @includedir@/evms
evmspluginsdir	:= @libdir@/evms/$(VERSION)

# Variables that most Makefiles will use.
SOURCES		:= $(wildcard *.c)
HEADERS		:= $(wildcard *.h)
MANPAGES	:= $(wildcard *.8)
OBJECTS		= $(SOURCES:.c=.o)
SBIN_TARGET	= $(NAME)
LIB_TARGET	= lib$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).so.0.$(PATCH_LEVEL)
PLUGIN_TARGET	= $(NAME)-$(VERSION).so
SONAME		= lib$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).so.0
ARNAME		= lib$(NAME).a
LIBNAME		= lib$(NAME).so

# Macros to use to run make recursively over a set of directories, which
# must be specified in the $(subdirs) or $(distsubdirs) variable.
PROCESS_DIRS	=			\
	+@for dir in $(subdirs); do	\
		$(MAKE) -C $$dir $@ ||	\
		case "$(MAKEFLAGS)" in	\
			*k*) fail=yes;;	\
			*) exit 1;;	\
		esac;			\
	done && test -z "$$fail"

PROCESS_DISTDIRS =			\
	+@for dir in $(distsubdirs); do	\
		$(MAKE) -C $$dir $@ ||	\
		case "$(MAKEFLAGS)" in	\
			*k*) fail=yes;;	\
			*) exit 1;;	\
		esac;			\
	done && test -z "$$fail"

# Macros to build libraries and binaries.
BUILD_SHARED_LIB = $(CC) -shared $(EVMS_LDFLAGS) -Wl,-soname,$(SONAME),--version-script,.export -o $(TARGET) $(OBJECTS) $(EVMS_LIBS)
BUILD_STATIC_LIB = $(AR) rcs $(ARNAME) $(OBJECTS)
BUILD_PLUGIN = $(CC) -shared $(EVMS_LDFLAGS) -Wl,--version-script,.export -o $(TARGET) $(OBJECTS) $(EVMS_LIBS)
BUILD_SBIN = $(CC) -L$(top_srcdir)/engine $(EVMS_LDFLAGS) -o $(TARGET) $(OBJECTS) -levms $(EVMS_LIBS) $(PTHREAD_LIBS)

.PHONY: install uninstall clean distclean
.SUFFIXES: .c .o

# Compiling .c's to .o's
%.o: %.c
	$(CC) $(EVMS_CPPFLAGS) $(CPPFLAGS) $(EVMS_DEFS) $(EVMS_CFLAGS) $(CFLAGS) -c $< -o $@

# Generating dependencies
.depend:
	$(CPP) -M $(EVMS_CPPFLAGS) $(CPPFLAGS) $(EVMS_DEFS) $(SOURCES) > .depend

# Generating linker version-scripts for the plugins.
.export:
	echo "EVMS { global: evms_plugin_records; local: *; };" > .export