File: makemake

package info (click to toggle)
puf 0.91-0beta6a1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 372 kB
  • ctags: 345
  • sloc: ansic: 2,877; sh: 330; makefile: 108
file content (72 lines) | stat: -rwxr-xr-x 2,174 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
#! /usr/bin/make -f

op:=(
cp:=)
PACKAGE:=$(shell sed -ne 's/ *AM_INIT_AUTOMAKE *$(op) *\$(op)[^ ]*\$(cp) *, *\$(op)[^ ]*\$(cp) *$(cp) *$$/\1/p; t end; d; :end q' <configure.in)
VERSION:=$(shell sed -ne 's/ *AM_INIT_AUTOMAKE *$(op) *\$(op)[^ ]*\$(cp) *, *\$(op)[^ ]*\$(cp) *$(cp) *$$/\2/p; t end; d; :end q' <configure.in)
OUTPUT:=$(shell sed -ne 's/ *AC_OUTPUT *$(op) *\$(op) *[^$(cp)]*\$(cp) *$(cp) *$$/\1/p; t end; d; :end q' <configure.in)
MOUTPUT:=$(shell for i in $(OUTPUT); do test $${i\#\#*/} = Makefile && echo $$i; done)
OOUTPUT:=$(shell for i in $(OUTPUT); do test $${i\#\#*/} != Makefile && echo $$i; done)

#this is environment-specific!
UPLOAD:=irz601:files/$(PACKAGE).tar.gz

all: configure

configure: configure.in $(addsuffix .am,$(MOUTPUT)) $(addsuffix .in,$(OOUTPUT))
	aclocal
	autoheader
	automake -a
	autoconf

Makefile: configure
	./configure

binary: Makefile
	make

clobber:
	@if test ! -d CVS; then \
	  echo "You don't have a toplevel CVS directory."; \
	  echo "You most certainly didn't use cvs to get these sources."; \
	  echo "But this function depends on cvs's information."; \
	  exit 1 ;\
	fi;\
	pwd=`pwd` ;\
	dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\
	for i in $$dirs; do \
	  if test ! -d "$$pwd/$$i/CVS"; then \
	    echo "D $$i" ;\
	    rm -rf "$$pwd/$$i"; \
	    continue; \
	  fi ;\
	  cd $$pwd/$$i ;\
	  for f in * .*; do \
	    if test ! -d "$$f"; then \
	      if grep "^/$$f/" CVS/Entries > /dev/null; then \
		a="b"; \
	      else \
	        echo "F $$i/$$f"; \
		rm -f "$$pwd/$$i/$$f"; \
	      fi; \
	    fi ; \
	  done; \
	done

typedefs.out:
	find . -name '*.c' -exec cpp -I. {} \; | gawk '/^typedef / {td=1; pa=0}; /{/ {pa++}; /}/ {pa--}; td==1 && pa==0 && /[ \t][^ \t]+;/ {print "-T " gensub(/.*[ \t]\**([^ \t]+);.*/, "\\1", 1); td=0}' | sort | uniq >typedefs.out

indent: typedefs.out
	read -p "Files: " && indent -kr -cli4 -ncs $$(<typedefs.out) $$REPLY

backup: clobber
	pd=$${PWD##*/}; cd ..; tar cjf $(PACKAGE).tar.bz2 $$pd

$(PACKAGE)-$(VERSION).tar.gz: Makefile
	make dist

dist: $(PACKAGE)-$(VERSION).tar.gz

upload:	dist
	scp $(PACKAGE)-$(VERSION).tar.gz $(UPLOAD)
	rm $(PACKAGE)-$(VERSION).tar.gz