include ../make.tmpl
-dmsetup: $(OBJECTS)
- $(CC) -o dmsetup dmsetup.o $(LD_FLAGS) -ldevmapper
+dmsetup: $(OBJECTS) $(interfacedir)/libdevmapper.so \
+ $(interfacedir)/libdevmapper.a
+ $(CC) -o dmsetup $(OBJECTS) $(LD_FLAGS) \
+ -L$(interfacedir) -L$(DESTDIR)/lib $(LIBS) \
+ -ldevmapper
install: dmsetup
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
INCLUDES+=-I. -I$(top_srcdir)/include
+ifdef DESTDIR
+ INCLUDES+=-I$(DESTDIR)/usr/include
+endif
+
ifneq ("@missingkernel@", "yes")
INCLUDES+=-I$(kerneldir)/include
endif
%.d: %.c
set -e; \
- FILE=`echo $@ | \
- sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
- DEPS=`echo $(DEPS) | \
- sed -e 's/\\//\\\\\\//g'`; \
+ FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
+ DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
$(CC) -MM $(INCLUDES) $(CFLAGS) $< | \
sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d : $$DEPS /g" > $@; \
[ -s $@ ] || $(RM) $@