2 # Makefile for the Portability library
8 # extra files to be put into the distribution
9 DIST_FILES = Makedefs.in \
16 # these are the targets
17 LIBRARY = $(buildlibdir)/libNwsPortability.a
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
30 .PHONY: clean confclean distclean precondition dist all common
32 all: precondition common $(OBJS)
33 $(AR) $(ARFLAGS) $(LIBRARY) $(OBJS)
37 @for subdir in $(SUBDIRS); do \
38 (cd $$subdir && $(MAKE) all) || exit $$? ; done
41 @for subdir in $(SUBDIRS); do \
42 (cd $$subdir && $(MAKE) clean) || exit $$? ; done
46 @echo "Removing configurations files ..."
47 @$(RM) -f Makedefs Include/config_portability.h config.status config.log config.cache
50 @echo "Removing build directories ..."
51 @$(RM) -rf $(builddir) $(DIST_NAME)
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)
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)
75 @if test `./config.guess` != "$(configured)"; then \
76 echo "Portability was configured for $(configured): run make confclean and reconfigure for the `./config.guess`!";\
78 @$(INSTALL) -d $(buildobjdir)
79 @$(INSTALL) -d $(buildlibdir)
80 @$(INSTALL) -d $(buildincdir)
81 @$(INSTALL) -d $(buildbindir)
83 Makedefs: Makedefs.in config.status
86 config.status: configure
89 $(buildobjdir)/%.o : %.c Include/%.h Include/config_portability.h
90 $(CC) $(INCLUDES) $(CFLAGS) -g -c $< -o $@