1#
2# Makefile for dlcompat
3#
4#
5# Copyright (c) 2001 Christoph Pfisterer.
6#
7# Portions Copyright (c) 1999-2001 Apple Computer, Inc. All Rights
8# Reserved.
9#
10# This file contains Original Code and/or Modifications of Original
11# Code as defined in and that are subject to the Apple Public Source
12# License Version 1.2 (the "License"). You may not use this file
13# except in compliance with the License. Please obtain a copy of the
14# License at http://www.apple.com/publicsource and read it before
15# using this file.
16#
17# The Original Code and all software distributed under the License are
18# distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
22# NON-INFRINGEMENT. Please see the License for the specific language
23# governing rights and limitations under the License.
24# 
25
26
27prefix=/usr/local
28DEBUG=0
29
30CC=cc
31CFLAGS=-Wall -O2 -DDEBUG=$(DEBUG)
32AR=ar cru
33RANLIB=ranlib
34INSTALL=install
35
36OBJS = dlopen.o
37
38
39all: libdl.a libdl.dylib
40
41install: all
42	if test ! -d $(prefix)/lib ; then mkdir $(prefix)/lib ; fi
43	$(INSTALL) -m 644 libdl.a $(prefix)/lib
44	$(RANLIB) $(prefix)/lib/libdl.a
45	chmod 644 $(prefix)/lib/libdl.a
46	$(INSTALL) -m 755 libdl.dylib $(prefix)/lib
47	if test ! -d $(prefix)/include ; then mkdir $(prefix)/include ; fi
48	$(INSTALL) -c -m 644 dlfcn.h $(prefix)/include
49
50.c.o:
51	$(CC) $(CFLAGS) -fno-common -o $@ -c $<
52
53libdl.a: $(OBJS)
54	$(AR) libdl.a $(OBJS)
55	$(RANLIB) libdl.a
56
57libdl.dylib: $(OBJS)
58	$(CC) -dynamiclib -undefined suppress -o libdl.dylib $(OBJS) -install_name $(prefix)/lib/libdl.dylib
59
60clean:
61	rm -f $(OBJS) libdl.*
62
63# EOF
64