Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make dist now works
[simgrid.git] / src / nws_portability / Makefile
1 #
2 # Makefile for the Portability library
3 #
4 # $Id$
5
6 include Makedefs
7
8 # extra files to be put into the distribution
9 DIST_FILES      =       Makedefs.in \
10                         Makefile \
11                         config.guess \
12                         config.sub \
13                         install-sh \
14                         configure 
15
16 # these are the targets
17 LIBRARY =       $(buildlibdir)/libNwsPortability.a
18
19 # what we are going to put in the library
20 OBJS =          $(buildobjdir)/diagnostic.o \
21                 $(buildobjdir)/dnsutil.o \
22                 $(buildobjdir)/formatutil.o \
23                 $(buildobjdir)/osutil.o \
24                 $(buildobjdir)/messages.o \
25                 $(buildobjdir)/strutil.o \
26                 $(buildobjdir)/timeouts.o \
27                 $(buildobjdir)/protocol.o
28
29
30 .PHONY: clean confclean distclean precondition dist all common
31
32 all: precondition common $(OBJS)
33         $(AR) $(ARFLAGS) $(LIBRARY) $(OBJS)
34         $(RANLIB) $(LIBRARY)
35
36 common: 
37         @for subdir in $(SUBDIRS); do \
38                 (cd $$subdir && $(MAKE) all) || exit $$? ; done
39
40 clean:
41         @for subdir in $(SUBDIRS); do \
42                 (cd $$subdir && $(MAKE) clean) || exit $$? ; done
43         @$(RM) -f $(OBJS)
44
45 confclean:
46         @echo "Removing configurations files ..."
47         @$(RM) -f Makedefs Include/config_portability.h config.status config.log config.cache
48         
49 distclean: confclean
50         @echo "Removing build directories ..."
51         @$(RM) -rf $(builddir) $(DIST_NAME)
52
53 distdir:
54         $(INSTALL) -d $(DIST_ROOT)
55         for subdir in $(SUBDIRS); do \
56                 (cd $$subdir && $(MAKE) dist) || exit $$? ; done
57         $(CP)  $(DIST_FILES) $(DIST_ROOT)
58         $(CP) *.c $(DIST_ROOT)
59
60 .PHONY: install
61 install: all 
62         @$(INSTALL) -d $(prefix)
63         @$(INSTALL) -d $(exec_prefix)
64         @$(INSTALL) -d $(bindir)
65         @$(INSTALL) -d $(libdir)
66         @$(INSTALL) -d $(incdir)
67         @$(CP) $(buildbindir)/* $(bindir)
68         @$(CP) $(buildlibdir)/* $(libdir)
69         @$(CP) $(buildincdir)/* $(incdir)
70
71 tags:
72         $(CTAGS) -R 
73
74 precondition: 
75         @if test `./config.guess` != "$(configured)"; then \
76                 echo "Portability was configured for $(configured): run make confclean and reconfigure for the `./config.guess`!";\
77                 exit 1; fi
78         @$(INSTALL) -d $(buildobjdir)
79         @$(INSTALL) -d $(buildlibdir)
80         @$(INSTALL) -d $(buildincdir)
81         @$(INSTALL) -d $(buildbindir)
82
83 Makedefs: Makedefs.in config.status
84         ./config.status
85
86 config.status: configure
87         ./configure
88
89 $(buildobjdir)/%.o : %.c Include/%.h Include/config_portability.h
90         $(CC) $(INCLUDES) $(CFLAGS) -g -c $< -o $@
91         
92