3 # Copyright (C) 2000 by Lineo, inc.
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # Derived in part from the Linux-8086 C library, the GNU C Library, and several
20 # other sundry sources. Files within this library are copyright by their
21 # respective copyright holders.
24 include $(TOPDIR)Rules.mak
27 LIBCRYPT_SHARED=libcrypt.so
28 TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
30 CSRC = crypt.c des.c md5.c
31 COBJS=$(patsubst %.c,%.o, $(CSRC))
36 all: $(OBJS) $(LIBCRYPT)
38 $(LIBCRYPT): ar-target
41 $(AR) $(ARFLAGS) $(LIBCRYPT) $(OBJS)
44 $(TARGET_CC) $(CFLAGS) -c $< -o $@
45 $(STRIPTOOL) -x -R .note -R .comment $*.o
50 $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED).$(MAJOR_VERSION) \
51 -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME)
54 install -d $(INSTALL_DIR)/lib
55 install -m 644 $(LIBCRYPT) $(INSTALL_DIR)/lib/
56 @if [ -f $(LIBCRYPT_SHARED).$(MAJOR_VERSION) ] ; then \
57 install -m 644 $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \
58 (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(LIBCRYPT_SHARED)); \
62 rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)*