OSDN Git Service

Don't hard code path to TARGET_CC
[uclinux-h8/uClibc.git] / libcrypt / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000 by Lineo, inc.
4 #
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
8 # later version.
9 #
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
13 # details.
14 #
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
18 #
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.
22
23 TOPDIR=../
24 include $(TOPDIR)Rules.mak
25
26 LIBCRYPT=libcrypt.a
27 LIBCRYPT_SHARED=libcrypt.so
28 TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
29
30 CSRC = crypt.c des.c md5.c
31 COBJS=$(patsubst %.c,%.o, $(CSRC))
32
33
34 OBJS=$(COBJS)
35
36 all: $(OBJS) $(LIBCRYPT)
37
38 $(LIBCRYPT): ar-target
39
40 ar-target: $(OBJS)
41         $(AR) $(ARFLAGS) $(LIBCRYPT) $(OBJS)
42
43 $(COBJS): %.o : %.c
44         $(TARGET_CC) $(CFLAGS) -c $< -o $@
45         $(STRIPTOOL) -x -R .note -R .comment $*.o
46
47 $(OBJ): Makefile
48
49 shared: $(LIBCRYPT)
50         $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED).$(MAJOR_VERSION) \
51             -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME)
52
53 install: all
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)); \
59         fi;
60
61 clean: 
62         rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)*
63
64 .PHONY: dummy
65
66