blob: a99d3d86fc2ebb15a3efa799af4758b01d8ba3d6 [file] [log] [blame]
Robert Griebl1fca5582002-06-04 20:45:46 +00001# Makefile for busybox
2#
Mike Frysinger0d4ee682005-09-24 06:01:57 +00003# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
Robert Griebl1fca5582002-06-04 20:45:46 +00004#
Mike Frysinger0d4ee682005-09-24 06:01:57 +00005# Licensed under the GPL v2, see the file LICENSE in this tarball.
Robert Griebl1fca5582002-06-04 20:45:46 +00006
Bernhard Reutner-Fischer07a79e72006-03-09 09:03:37 +00007srcdir:=$(top_srcdir)/libpwdgrp
8objdir:=$(top_builddir)/libpwdgrp
Eric Andersen9615a082004-07-15 12:53:49 +00009
Eric Andersen7daa0762004-10-08 07:46:08 +000010LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
Bernhard Reutner-Fischer5d261262006-03-01 22:54:48 +000011LIBPWDGRP_M0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r fgetgrent_r \
12 fgetpwent fgetgrent getpwnam_r getgrnam_r getpwuid_r \
13 getgrgid_r getpwuid getgrgid getpwnam getgrnam getpw \
14 getpwent_r getgrent_r getpwent getgrent \
15 initgroups putpwent putgrent
16LIBPWDGRP_MOBJ0=$(patsubst %,$(objdir)/%$(om),$(LIBPWDGRP_M0-y))
17$(LIBPWDGRP_MOBJ0): $(LIBPWDGRP_MSRC0)
Eric Andersen9615a082004-07-15 12:53:49 +000018
Eric Andersen7daa0762004-10-08 07:46:08 +000019LIBPWDGRP_MSRC1:=$(srcdir)/pwd_grp.c
Bernhard Reutner-Fischer5d261262006-03-01 22:54:48 +000020LIBPWDGRP_M1-$(CONFIG_USE_BB_PWD_GRP):= __parsepwent __parsegrent \
21 __pgsreader fgetspent_r fgetspent sgetspent_r getspnam_r \
22 getspnam getspent_r getspent sgetspent \
23 putspent __parsespent # getspuid_r getspuid
24LIBPWDGRP_MOBJ1=$(patsubst %,$(objdir)/%$(om),$(LIBPWDGRP_M1-y))
25$(LIBPWDGRP_MOBJ1): $(LIBPWDGRP_MSRC1)
Robert Griebl1fca5582002-06-04 20:45:46 +000026
Bernhard Reutner-Fischer5d261262006-03-01 22:54:48 +000027LIBPWDGRP_DEFINE0-y:=$(patsubst %,-DL_%,$(LIBPWDGRP_M0-y))
28LIBPWDGRP_DEFINE1-y:=$(patsubst %,-DL_%,$(LIBPWDGRP_M1-y))
Robert Griebl1fca5582002-06-04 20:45:46 +000029
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000030LIBPWDGRP_SRC-y:=$(LIBPWDGRP_MSRC0)
31
32LIBRARY_SRC-y+=$(LIBPWDGRP_SRC-y)
33LIBRARY_SRC-a+=$(LIBPWDGRP_SRC-y)
34
35LIBRARY_DEFINE-y+=$(LIBPWDGRP_DEFINE0-y) $(LIBPWDGRP_DEFINE1-y)
36LIBRARY_DEFINE-a+=$(LIBPWDGRP_DEFINE0-y) $(LIBPWDGRP_DEFINE1-y)
37
Bernhard Reutner-Fischer5d261262006-03-01 22:54:48 +000038libpwdgrp_MOBJ$(os):=$(LIBPWDGRP_MOBJ0) $(LIBPWDGRP_MOBJ1)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000039
Bernhard Reutner-Fischer5d261262006-03-01 22:54:48 +000040ifeq ($(om),.osm)
41# XXX FIXME:
42# also create a pattern for the non-shared case
43$(LIBPWDGRP_MOBJ0:.osm=.om): $(LIBPWDGRP_MSRC0)
44$(LIBPWDGRP_MOBJ1:.osm=.om): $(LIBPWDGRP_MSRC1)
45endif
Bernhard Reutner-Fischer07a79e72006-03-09 09:03:37 +000046
47$(objdir)/libpwdgrp.a: $(libpwdgrp_MOBJ$(os))
48libraries-y:=$(libraries-y) $(objdir)/libpwdgrp.a
49