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 @$(RM) -rf $(DIST_ROOT) $(DIST_NAME)
55 @$(INSTALL) -d $(DIST_ROOT)
56 @for subdir in $(SUBDIRS); do \
57 (cd $$subdir && $(MAKE) dist) || exit $$? ; done
58 @$(CP) $(DIST_FILES) $(DIST_ROOT)
59 @$(CP) *.c $(DIST_ROOT)
60 @$(TAR) cf $(TOP)/$(DIST_NAME) Portability
61 @$(RM) -rf $(DIST_ROOT)
65 @$(INSTALL) -d $(prefix)
66 @$(INSTALL) -d $(exec_prefix)
67 @$(INSTALL) -d $(bindir)
68 @$(INSTALL) -d $(libdir)
69 @$(INSTALL) -d $(incdir)
70 @$(CP) $(buildbindir)/* $(bindir)
71 @$(CP) $(buildlibdir)/* $(libdir)
72 @$(CP) $(buildincdir)/* $(incdir)
78 @if test `./config.guess` != "$(configured)"; then \
79 echo "Portability was configured for $(configured): run make confclean and reconfigure for the `./config.guess`!";\
81 @$(INSTALL) -d $(buildobjdir)
82 @$(INSTALL) -d $(buildlibdir)
83 @$(INSTALL) -d $(buildincdir)
84 @$(INSTALL) -d $(buildbindir)
86 Makedefs: Makedefs.in config.status
89 config.status: configure
92 $(buildobjdir)/%.o : %.c Include/%.h Include/config_portability.h
93 $(CC) $(INCLUDES) $(CFLAGS) -g -c $< -o $@