-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
123 lines (93 loc) · 3.65 KB
/
Makefile.am
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# System: Structured text retrieval tool sgrep.
# Module: Makefile
# Author: Pekka Kilpeläinen & Jani Jaakkola
# Description: Makefile for building & installing sgrep
# Version history: Original version February 1995 by JJ & PK
# Copyright: University of Helsinki, Dept. of Computer Science
EXTRA_DIST = sgrep.1 sgrep.lsm sample.sgreprc
DOC_DIST = README AUTHORS COPYING ChangeLog INSTALL NEWS
EDITOR_FILES = $(SOURCES) Makefile.am configure.in ChangeLog NEWS README \
acconfig.in
# Sgrep needs to know its share directory
INCLUDES = -DDATADIR="\"${datadir}\""
bin_PROGRAMS = sgrep
libsgrep_SOURCES = main.c preproc.c common.c parser.c optimize.c pmatch.c \
sgml.c eval.c output.c index.c sysdeps.c sgrep.h sysdeps.h
sgrep_SOURCES = $(libsgrep_SOURCES) index_main.c
data_DATA=sample.sgreprc
man_MANS=sgrep.1
# The rest of this file is my private stuff
BIN_DIST = $(DOC_DIST) $(EXTRA_DIST)
WIN_BINS = sgrep.exe cygwinb19.dll m4.exe
BUILD_SYSTEMS = hydra sirppi karhu pneuma
# Some cool rules, which you really should not try at home
windist:
rm -f sgrep-$(VERSION).zip
zip -l sgrep-$(VERSION).zip $(BIN_DIST)
cd win32; zip ../sgrep-$(VERSION).zip $(WIN_BINS)
chmod a+r sgrep-$(VERSION).zip
bindist: $(bin_PROGRAMS)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
for file in $(BIN_DIST); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
for file in $(bin_PROGRAMS); do \
d=$(top_builddir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
$(TAR) cf - $(distdir) | gzip > $(distdir)-`uname -m | sed 's/\//-/g'`-`uname -s`.tar.gz
-chmod a+r $(distdir)-`uname -m | sed 's/\//-/g'`-`uname -s`.tar.gz
-rm -rf $(distdir)
update-build-directory: dist
cat $(distdir).tar.gz | ssh melkki "tee $(distdir).tar.gz | tar zvxf -"
CONFIGURE_OPTIONS = CC=cc; CFLAGS=-O2; export CC; export CFLAGS
build-all-binaries:
for i in $(BUILD_SYSTEMS); do \
( ssh $$i "cd $(distdir) && mkdir $$i; cd $$i && \
sh -c '$(CONFIGURE_OPTIONS); ../configure' && \
make" ) & \
done; for i in $(BUILD_SYSTEMS); do wait; done
clean-all-binaries:
ssh melkki "for i in $(BUILD_SYSTEMS);do rm -rf $(distdir)/"'$$i'"; done"
RELEASE_DIR= /home/ftp/pub/Software/Local/Sgrep
release: dist
scp $(distdir).tar.gz melkki:$(RELEASE_DIR)
release-binary: bindist
scp $(distdir)-`uname -m | sed 's/\//-/g'`-`uname -s`.tar.gz melkki.cs:$(RELEASE_DIR)
release-winbinary: windist
scp $(distdir).zip melkki:$(RELEASE_DIR)
release-all-binaries:
for i in $(BUILD_SYSTEMS); do \
ssh $$i "cd $(distdir)/$$i && make bindist"; \
done
for i in $(BUILD_SYSTEMS); do \
ssh melkki.cs "cp $(distdir)/$$i/sgrep-*.tar.gz $(RELEASE_DIR)"; \
done
edit:
xemacs $(EDITOR_FILES) &
# Sometimes while editing and compiling Win32-version of sgrep, the
# files get littered by unintentional and ugly carriage returns.
unixify:
for i in $(DISTFILES); do sed `printf "s/\r//g"` < $$i > tmpfile; mv tmpfile $$i; done
# These hook exists for building the commercial part of sgrep,
# the sgrep-library. It is not distributed under GPL and is not
# available for downloading.
libdist: Makefile.lib
$(MAKE) -f Makefile.lib VERSION="$(VERSION)" dist
libclean: Makefile.lib
$(MAKE) -f Makefile.lib clean
library: $(SGREP_OBJECTS)
@if test -f $(srcdir)/Makefile.lib ; then $(MAKE) -f $(srcdir)/Makefile.lib DEFS='$(DEFS)'; fi
all-local: #library
clean-local:
@if test -f $(srcdir)/Makefile.lib ; then $(MAKE) -f $(srcdir)/Makefile.lib clean; fi
distclean-local: clean-local
maintainer-clean-local: clean-local