# Makefile for compiling the native ldconfig tool needed to install
# libraries in target root filesystem
#
# Author : Bernard Dautrevaux
# Date 	 : 2018-02-23
# Ac6

CC		= 	gcc
CFLAGS	=	-std=gnu99 -I.
OBJECTS	=	ldconfig.o chroot_canon.o xmalloc.o xstrdup.o cache.o readlib.o dl-cache.o

all: ldconfig

ldconfig: $(OBJECTS)
		$(CC) $(CFLAGS) -o $@ $(OBJECTS)

install: ldconfig
		install -d $(DESTDIR)/sbin
		install -m 755 ldconfig $(DESTDIR)/sbin

clean distclean:
		rm -f *.o ldconfig
	