/[baselayout]/trunk/src/Makefile
Gentoo

Diff of /trunk/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2874 Revision 2875
12# http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/116081 12# http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/116081
13# to fix this. We include this patch with Gentoo/FreeBSD :) 13# to fix this. We include this patch with Gentoo/FreeBSD :)
14 14
15CC ?= gcc 15CC ?= gcc
16CFLAGS += -O2 -pipe 16CFLAGS += -O2 -pipe
17LDFLAGS += -L.
17 18
18# GNU Make way of detecting gcc flags we can use 19# GNU Make way of detecting gcc flags we can use
19check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ 20check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
20 then echo "$(1)"; else echo "$(2)"; fi) 21 then echo "$(1)"; else echo "$(2)"; fi)
21 22
42LIB = lib 43LIB = lib
43 44
44# Set PAM = pam for pam support 45# Set PAM = pam for pam support
45PAM = 46PAM =
46 47
47# Load an optional OS Makefile
48_OS_SH = u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${u}";; esac
49_OS != $(_OS_SH)
50OS ?= $(_OS)$(shell $(_OS_SH))
51-include Makefile.$(OS)
52-include Makefile.$(PAM)
53
54LIBEINFOSOVER = 0 48LIBEINFOSOVER = 0
55LIBEINFOSO = libeinfo.so.$(LIBRCSOVER) 49LIBEINFOSO = libeinfo.so.$(LIBRCSOVER)
56LIBEINFOOBJS= libeinfo.o 50LIBEINFOOBJS= libeinfo.o
57 51
58LIBRCSOVER = 0 52LIBRCSOVER = 0
59LIBRCSO = librc.so.$(LIBRCSOVER) 53LIBRCSO = librc.so.$(LIBRCSOVER)
60LIBRCOBJS = librc.o librc-depend.o librc-daemon.o librc-misc.o librc-strlist.o 54LIBRCOBJS = librc.o librc-depend.o librc-daemon.o librc-misc.o librc-strlist.o
61LDLIBS_LIBRC = $(LIBEINFOSO) 55LDLIBS_LIBRC = -leinfo
62 56
63RCOBJS = env-update.o fstabinfo.o mountinfo.o \ 57RCOBJS = env-update.o fstabinfo.o mountinfo.o \
64 rc-depend.o rc-plugin.o rc-status.o rc-update.o runscript.o \ 58 rc-depend.o rc-plugin.o rc-status.o rc-update.o runscript.o \
65 start-stop-daemon.o rc.o 59 start-stop-daemon.o rc.o
60LDLIBS_RC = $(LDLIBS_LIBRC) -lrc
66 61
67LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO) 62LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO)
68SBIN_TARGETS = rc 63SBIN_TARGETS = rc
69SYS_WHITELIST = env_whitelist 64SYS_WHITELIST = env_whitelist
70 65
96# issues. However, this does ease development a little 91# issues. However, this does ease development a little
97_SVN_LDFLAGS_SH = if test -d .svn; then echo "-Wl,-rpath ."; else echo ""; fi 92_SVN_LDFLAGS_SH = if test -d .svn; then echo "-Wl,-rpath ."; else echo ""; fi
98_SVN_LDFLAGS != $(_SVN_LDFLAGS_SH) 93_SVN_LDFLAGS != $(_SVN_LDFLAGS_SH)
99LDFLAGS += $(_SVN_LDFLAGS)$(shell $(_SVN_LDFLAGS_SH)) 94LDFLAGS += $(_SVN_LDFLAGS)$(shell $(_SVN_LDFLAGS_SH))
100 95
96# Load an optional OS Makefile
97_OS_SH = u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${u}";; esac
98_OS != $(_OS_SH)
99OS ?= $(_OS)$(shell $(_OS_SH))
100-include Makefile.$(OS)
101-include Makefile.$(PAM)
102
101all: .depend $(TARGET) 103all: .depend $(TARGET)
102 104
103$(LIBEINFOOBJS): 105$(LIBEINFOOBJS):
104 $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $< 106 $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
105$(LIBEINFOSO): $(LIBEINFOOBJS) 107$(LIBEINFOSO): $(LIBEINFOOBJS)
107 ln -sf $(LIBEINFOSO) libeinfo.so 109 ln -sf $(LIBEINFOSO) libeinfo.so
108 110
109$(LIBRCOBJS): 111$(LIBRCOBJS):
110 $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $< 112 $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
111$(LIBRCSO): $(LIBRCOBJS) $(LIBEINFOSO) 113$(LIBRCSO): $(LIBRCOBJS) $(LIBEINFOSO)
112 $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,$(LIBRCSO) -o $(LIBRCSO) $(LDLIBS_LIBRC) $(LIBRCOBJS) 114 $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,$(LIBRCSO) -o $(LIBRCSO) $(LIBRCOBJS) $(LDLIBS_LIBRC)
113 ln -sf $(LIBRCSO) librc.so 115 ln -sf $(LIBRCSO) librc.so
114 116
115$(RCOBJS): 117$(RCOBJS):
116 $(CC) $(CPPFLAGS) $(CPPFLAGS_SSD) $(CFLAGS) -c $< 118 $(CC) $(CPPFLAGS) $(CPPFLAGS_SSD) $(CFLAGS) -c $<
117rc: $(LIBEINFOSO) $(LIBRCSO) $(RCOBJS) 119rc: $(LIBEINFOSO) $(LIBRCSO) $(RCOBJS)
118 $(CC) $(LDFLAGS) -o rc $(RCOBJS) $(LIBRCSO) $(LIBEINFOSO) $(LDLIBS_SSD) $(LDLIBS_RC) 120 $(CC) $(LDFLAGS) -o rc $(RCOBJS) $(LDLIBS_RC)
119 121
120links: rc 122links: rc
121 for x in $(BINLINKS) $(SBINLINKS) $(RCLINKS) $(RCPRIVLINKS); do ln -sf rc $$x; done 123 for x in $(BINLINKS) $(SBINLINKS) $(RCLINKS) $(RCPRIVLINKS); do ln -sf rc $$x; done
122 124
123install: $(TARGET) 125install: $(TARGET)

Legend:
Removed from v.2874  
changed lines
  Added in v.2875

  ViewVC Help
Powered by ViewVC 1.1.20