File: Makefile

package info (click to toggle)
nws 2.11-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,700 kB
  • ctags: 2,820
  • sloc: ansic: 28,849; sh: 3,289; java: 1,205; makefile: 697; perl: 12
file content (107 lines) | stat: -rwxr-xr-x 2,889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Makefile for the Portability library
#
# $Id: Makefile,v 1.41 2004/10/29 21:32:47 graziano Exp $

include Makedefs

# extra files to be put into the distribution
DIST_FILES	= 	Makedefs.in \
			Makefile \
			config.guess \
			config.sub \
			install-sh \
			configure 

# these are the targets
LIBRARY =	$(buildlibdir)/libNwsPortability.a

# what we are going to put in the library
OBJS = 		$(buildobjdir)/diagnostic.o \
		$(buildobjdir)/dnsutil.o \
		$(buildobjdir)/formatutil.o \
		$(buildobjdir)/osutil.o \
		$(buildobjdir)/messages.o \
		$(buildobjdir)/strutil.o \
		$(buildobjdir)/timeouts.o \
		$(buildobjdir)/protocol.o
FORECAST_OBJS = $(buildobjdir)/exp_smooth.o \
		$(buildobjdir)/fbuff.o \
		$(buildobjdir)/forc.o \
		$(buildobjdir)/nws_forecast_api.o \
		$(buildobjdir)/last_value.o \
		$(buildobjdir)/median.o \
		$(buildobjdir)/mse_forc.o \
		$(buildobjdir)/run_mean.o

.PHONY: clean distclean precondition dist all common

all: precondition common $(LIBRARY)


$(LIBRARY): $(OBJS) $(FORECAST_OBJS)
	$(AR) $(ARFLAGS) $(LIBRARY) $(OBJS) $(FORECAST_OBJS)
	$(RANLIB) $(LIBRARY)

common: 
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) all) || exit $$? ; done

clean:
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) clean) || exit $$? ; done
	@$(RM) -f $(OBJS)
	@$(RM) -f $(LIBRARY)

distclean: clean
	@echo "Removing build directories ..."
	@$(RM) -rf $(builddir) $(DIST_NAME)
	@echo "Removing configurations files ..."
	@$(RM) -f Makedefs Include/config_portability.h config.status config.log config.cache
	@$(RM) -rf $(DIST_ROOT)

dist: 
	@$(INSTALL) -d $(DIST_ROOT)
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) dist) || exit $$? ; done
	@$(CP)  $(DIST_FILES) $(DIST_ROOT)
	@$(CP) *.c $(DIST_ROOT)
	@(cd $(DIST_ROOT); $(TAR) -xf $(TOP)/$(FORECASTDIR)/$(FORECASTDIR).tar)
	@(cd $(TOP) && $(TAR) cf $(TOP)/$(DIST_NAME) $(DIST_DIR))
	@$(RM) -rf $(DIST_ROOT)

.PHONY: install
install: all 
	@test -w $(prefix) || $(INSTALL) -d $(prefix)
	@test -w $(bindir) || $(INSTALL) -d $(bindir)
	@test -w $(libdir) || $(INSTALL) -d $(libdir)
	@test -w $(incdir) || $(INSTALL) -d $(incdir)
	@$(CP) $(buildbindir)/* $(bindir)
	@$(CP) $(buildlibdir)/* $(libdir)
	@for subdir in $(SUBDIRS); do \
		(cd $$subdir && $(MAKE) install) || exit $$? ; done


tags:
	$(CTAGS) -R 

precondition: 
	@if test `./config.guess` != "$(configured)"; then \
		echo "Portability was configured for $(configured)!!"; \
		echo "you may want to run make clean and reconfigure for `./config.guess`!";\
		sleep 5 1; fi
	@$(INSTALL) -d $(buildobjdir)
	@$(INSTALL) -d $(buildlibdir)
	@$(INSTALL) -d $(buildincdir)
	@$(INSTALL) -d $(buildbindir)

Makedefs: Makedefs.in config.status
	./config.status

config.status: configure
	@echo "You need to run configure!"; exit 1

$(buildobjdir)/%.o : %.c Include/%.h Include/config_portability.h
	$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@