GNUmakefile.in 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9
#-------------------------------------------------------------------------
#
# Makefile.inc--
#    Build and install postgres.
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
B
Bruce Momjian 已提交
10
#    $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.21 1997/12/22 05:56:43 momjian Exp $
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#
#-------------------------------------------------------------------------

SRCDIR= .
include Makefile.global

FIND = @find@

# assuming gnu tar and split here
TAR  = @tar@
SPLIT = @split@

ETAGS = @etags@
XARGS = @xargs@

26
all:
B
Bruce Momjian 已提交
27
	@if test "$(PORTNAME)" = UNDEFINED; then \
28 29 30 31 32
	  echo You must set the PORTNAME value in Makefile.global before \
	       you can build Postgres. ;\
	  false ;\
        else true;\
	fi
33
	$(MAKE) -C lextest all
34 35 36 37 38 39 40 41
	@if test ! -f lextest/lextest; then \
	  echo "";\
	  echo "You have a buggy version of flex.  Read INSTALL and search for flex for a fix.";\
	  echo "";\
	  false;\
	else \
	  true;\
	fi
42 43
	$(MAKE) -C utils all
	$(MAKE) -C backend all
44
	$(MAKE) -C interfaces all
45 46 47 48 49 50 51 52
	$(MAKE) -C bin all
ifneq ($(wildcard man), )
	$(MAKE) -C man all
endif
	@if test $@. = all. -o $@. = .; then \
	echo All of PostgreSQL is successfully made.  Ready to install. ;\
        fi

53
install:
B
Bruce Momjian 已提交
54
	@if test "$(PORTNAME)" = UNDEFINED; then \
55 56 57 58 59 60 61 62 63 64 65 66 67
		echo You must set the PORTNAME value in Makefile.global before \
			you can build Postgres. ;\
		false ;\
	else true;\
	fi
	$(MAKE) -C lextest install
	$(MAKE) -C utils install
	$(MAKE) -C backend install
	$(MAKE) -C interfaces install
	$(MAKE) -C bin install
ifneq ($(wildcard man), )
	$(MAKE) -C man install
endif
68
	cat ../register.txt
69

70
clean:
B
Bruce Momjian 已提交
71
	@if test "$(PORTNAME)" = UNDEFINED; then \
72 73 74 75 76
		echo You must set the PORTNAME value in Makefile.global before \
			you can build Postgres. ;\
		false ;\
	else true;\
	fi
B
Bruce Momjian 已提交
77
	$(MAKE) -C lextest clean
78 79
	$(MAKE) -C utils clean
	$(MAKE) -C backend clean
80
	$(MAKE) -C interfaces clean
81 82 83 84
	$(MAKE) -C bin clean
ifneq ($(wildcard man), )
	$(MAKE) -C man clean
endif
85 86

distclean: clean
87 88 89 90 91 92 93 94 95
	rm -f Makefile.global \
		config.cache \
		config.status \
		config.log \
		GNUmakefile \
		Makefile.global \
		backend/port/Makefile \
		bin/psql/Makefile \
		bin/pg_dump/Makefile \
96
		bin/pg_version/Makefile \
97
		include/config.h \
98
		backend/utils/Gen_fmgrtab.sh \
99 100
		include/os.h \
		Makefile.port
101

102

M
Marc G. Fournier 已提交
103
.DEFAULT:
B
Bruce Momjian 已提交
104
	@if test "$(PORTNAME)" = UNDEFINED; then \
105 106 107 108 109
	  echo You must set the PORTNAME value in Makefile.global before \
	       you can build Postgres. ;\
	  false ;\
        else true;\
	fi
B
Bruce Momjian 已提交
110
	$(MAKE) -C lextest $@
111 112
	$(MAKE) -C utils $@
	$(MAKE) -C backend $@
113
	$(MAKE) -C interfaces $@
114 115 116 117 118
	$(MAKE) -C bin $@
ifneq ($(wildcard man), )
	$(MAKE) -C man $@
endif
	@if test $@. = all. -o $@. = .; then \
119
	echo All of PostgreSQL is successfully made.  Ready to install. ;\
120 121 122 123
        fi

TAGS:
	rm -f TAGS; \
124
	for i in backend interfaces/libpq bin; do \
125 126 127 128 129 130 131 132 133 134 135 136 137
	  $(FIND) $$i -name '*.[chyl]' -print | $(XARGS) $(ETAGS) -a ; \
	done

# target to generate a backup tar file and split files that can be 
# saved to 1.44M floppy
BACKUP:
	rm -f BACKUP.filelist BACKUP.tgz; \
	$(FIND) . -not -path '*obj/*' -not -path '*data/*' -type f -print > BACKUP.filelist; \
	$(TAR) --files-from BACKUP.filelist -c -z -v -f BACKUP.tgz
	$(SPLIT) --bytes=1400k BACKUP.tgz pgBACKUP.	

.PHONY: TAGS
.PHONY: BACKUP
138