File: makemake

package info (click to toggle)
puf 1.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 836 kB
  • ctags: 688
  • sloc: ansic: 4,523; sh: 3,369; makefile: 56
file content (63 lines) | stat: -rwxr-xr-x 2,329 bytes parent folder | download | duplicates (3)
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
#! /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!
HP:=puf.sourceforge.net:/home/groups/p/pu/puf/htdocs

all: configure

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

Makefile: configure
	./configure

build: 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; \
	LC_COLLATE=C; export LC_COLLATE; \
	pwd=`pwd`; \
	incvs=$$pwd/.incvs; indir=$$pwd/.indir; \
	for i in `find . -follow -type d ! -name CVS | sed -e "s#^./##"`; do \
	  if test -d $$pwd/$$i; then \
	    cd $$pwd/$$i && \
	    sed -ne 's#^/\([^/]*\)/.*$$#\1#p;s#^D/\([^/]*\)/.*$$#\1/#p' < CVS/Entries | sort -t / +0 -1 > $$incvs && \
	    ls -LAF | sed -ne '\#^CVS/$$#d;\#^.incvs$$#d;\#^.indir$$#d;s#^\(.*\)[*=|>]$$#\1#;p' > $$indir && \
	    eval "`diff $$incvs $$indir | sed -ne 's#^> \(.*\)/$$#echo "D $$i/\1";rm -rf "$$pwd/$$i/\1"#p;s#^> \(.*[^/]\)$$#echo "F $$i/\1";rm -f "$$pwd/$$i/\1"#p'`"; \
	  fi; \
	done; \
	rm -f $$incvs $$indir

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

uphp:
	scp $(PACKAGE).html README ChangeLog TODO $(HP)