Merge branch 'develop'
[archipelago] / xseg / sys / user / Makefile
index 5b7c1d2..1ed1feb 100644 (file)
 # or implied, of GRNET S.A.
 #
 
-.PHONY: default all clean drivers install
+.PHONY: default all clean drivers install install-src
 
 include $(XSEG_HOME)/base.mk
 
+FILES="Makefile"
+FILES+=$(shell ls *.h)
+FILES+=$(shell ls *.c)
+
+EFILES+="make_symbol_map.sh"
+
+SUBDIR:=$(subst $(XSEG_HOME),,$(CURDIR))
+
 MAJOR=0
-MINOR=0.1
+MINOR=2
 AR=ar
 
 DRIVERS=xseg_posix xseg_segdev xseg_pthread
@@ -47,7 +55,7 @@ SHELL=/bin/bash
 default: all
 
 all: libxseg.a libxseg.so
-       make -C python
+       make -C python all MAJOR=$(MAJOR) MINOR=$(MINOR)
        make -C xq all
        make -C xpool all
        make -C xhash all
@@ -134,10 +142,29 @@ libxseg.a: xseg.o xq/xq.o drivers _initialize.o
        cp -vaf $@ $(LIB)
 
 install:
-       mkdir -p $(DESTDIR)$(libdir)
-       cp -vaf libxseg.so $(DESTDIR)$(libdir)
+       make -C python install
+       install -d $(DESTDIR)$(libdir)
+       #install -t $(DESTDIR)$(libdir) libxseg.so
+       #install -t $(DESTDIR)$(libdir) libxseg.so.$(MAJOR)
+       install -o 0 -g 0 -m 644 -t $(DESTDIR)$(libdir) libxseg.so.$(MAJOR).$(MINOR)
        cp -vaf libxseg.so.$(MAJOR) $(DESTDIR)$(libdir)
-       cp -vaf libxseg.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+       cp -vaf libxseg.so $(DESTDIR)$(libdir)
+
+install-src:
+       make -C xq install-src
+       make -C xpool install-src
+       make -C xhash install-src
+       make -C xheap install-src
+       make -C xobj install-src
+       make -C python install-src
+       install -d $(DESTDIR)$(srcdir)$(SUBDIR) ;
+       @for f in $(FILES) ; do \
+               install -o 0 -g 0 -m 644 -t $(DESTDIR)$(srcdir)$(SUBDIR) $$f ; \
+       done
+       @for f in $(EFILES) ; do \
+               install -o 0 -g 0 -m 755 -t $(DESTDIR)$(srcdir)$(SUBDIR) $$f ; \
+       done
+
 
 clean:
        make -C xq clean