source: trunk/packages/xen-3.1/xen-3.1/tools/libfsimage/common/Makefile @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.3 KB
Line 
1XEN_ROOT = ../../..
2include $(XEN_ROOT)/tools/Rules.mk
3
4MAJOR = 1.0
5MINOR = 0
6
7CFLAGS += -Werror -Wp,-MD,.$(@F).d
8DEPS = .*.d
9
10LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
11LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
12LDFLAGS = $(LDFLAGS-y)
13
14LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
15
16PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
17
18LIB = libfsimage.so libfsimage.so.$(MAJOR) libfsimage.so.$(MAJOR).$(MINOR)
19
20.PHONY: all
21all: $(LIB)
22
23.PHONY: install
24install: all
25        [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
26        [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
27        $(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
28        ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so.$(MAJOR)
29        ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so
30        $(INSTALL_DATA) fsimage.h $(DESTDIR)/usr/include
31        $(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)/usr/include
32        $(INSTALL_DATA) fsimage_grub.h $(DESTDIR)/usr/include
33
34clean distclean:
35        rm -f $(PIC_OBJS) $(LIB)
36
37libfsimage.so: libfsimage.so.$(MAJOR)
38        ln -sf $< $@
39libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
40        ln -sf $< $@
41
42libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
43        $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
44
45-include $(DEPS)
46
Note: See TracBrowser for help on using the repository browser.