summaryrefslogtreecommitdiff
path: root/libstore/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-08-25 01:40:49 +0000
committerRoland McGrath <roland@gnu.org>2001-08-25 01:40:49 +0000
commitf504521328d05d922b0f0752fa3c8382b969e34b (patch)
tree8211802e8f5c0c2564a68d226ea3af57bbc44b47 /libstore/Makefile
parentfde3d6cc5a1f924685c66d596556642dde26808b (diff)
2001-08-24 Roland McGrath <roland@frob.com>
* Makefile (SRCS): Add part.c here. (OBJS): Mutate part.o -> parted.o here. (parted.o, parted_p.o, parted_pic.o): New targets. (LDFLAGS-libstore.so): Set to $(PARTED_LIBS).
Diffstat (limited to 'libstore/Makefile')
-rw-r--r--libstore/Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/libstore/Makefile b/libstore/Makefile
index 4a252bf4..3598a56c 100644
--- a/libstore/Makefile
+++ b/libstore/Makefile
@@ -26,16 +26,41 @@ libname = libstore
SRCS = create.c derive.c make.c rdwr.c set.c device.c file.c stripe.c \
enc.c encode.c decode.c clone.c argp.c std.c kids.c zero.c flags.c \
open.c remap.c xinl.c task.c typed.c copy.c gunzip.c map.c mvol.c \
- bunzip2.c
+ bunzip2.c part.c
LCLHDRS=store.h
installhdrs=store.h
HURDLIBS = shouldbeinlibc
UNZIP_OBJS = unzip.o inflate.o util.o do-bunzip2.o
-OBJS = $(SRCS:.c=.o) $(UNZIP_OBJS)
+OBJS = $(patsubst part.o,parted.o,$(SRCS:.c=.o)) $(UNZIP_OBJS)
# Look for zip stuff
VPATH += $(srcdir)/../exec
CPPFLAGS += -I$(srcdir)/../exec
include ../Makeconf
+
+ifeq (,$(strip $(PARTED_LIBS)))
+# Configure didn't find the Parted libraries, so we have no "part" store type.
+
+parted.o parted_p.o parted_pic.o:
+ $(CC) -o $@ -c -x c /dev/null
+
+else
+
+# We have Parted, so link against it. For the static libraries,
+# we slurp in all the Parted code we need and stuff it into one
+# object file along with our code that uses it.
+
+LDFLAGS-libstore.so += $(PARTED_LIBS)
+
+parted.o: part.o $(..)config.make
+ $(CC) -r -o $@ $< $(PARTED_LIBS)
+
+parted_p.o: part_p.o $(..)config.make
+ $(CC) -r -o $@ $< $(PARTED_LIBS:=_p)
+
+parted_pic.o: part_pic.o
+ ln -f $< $@
+
+endif