File: Makefile.in

package info (click to toggle)
wyrd 1.4.6-4
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 1,820 kB
  • ctags: 1,969
  • sloc: ml: 11,059; sh: 5,531; ansic: 760; makefile: 304; python: 44
file content (221 lines) | stat: -rw-r--r-- 4,907 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#
# sample Makefile for Objective Caml
# Copyright (C) 2001 Jean-Christophe FILLIATRE
#
# modified 10/26/2003 by Paul Pelzl, for the purpose of building Orpie
# modified 03/28/2005 by Paul Pelzl, for the purpose of building Wyrd
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License version 2, as published by the Free Software Foundation.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 
# See the GNU Library General Public License version 2 for more details
# (enclosed in the file LGPL).

# where to install the binaries, rcfiles, manpages, etc.
prefix      = @prefix@
exec_prefix = @exec_prefix@
sysconfdir  = @sysconfdir@
datarootdir = @datarootdir@
BINDIR      = $(DESTDIR)/@bindir@
MANDIR      = $(DESTDIR)/@mandir@

# other variables set by ./configure
OCAMLC       = @OCAMLC@
OCAMLOPT     = @OCAMLOPT@
OCAMLDEP     = @OCAMLDEP@
OCAMLLIB     = @OCAMLLIB@
OCAMLBEST    = @OCAMLBEST@
OCAMLLEX     = @OCAMLLEX@
OCAMLYACC    = @OCAMLYACC@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWIN32   = @OCAMLWIN32@
EXE          = @EXE@
DEFS         = @DEFS@
CC           = @CC@
CFLAGS       = @CFLAGS@
CPPFLAGS     = @CPPFLAGS@
LDFLAGS      = @LDFLAGS@
INSTALL      = @INSTALL@


INCLUDES = -I +curses
BFLAGS   = -pp camlp4o -g $(INCLUDES)
OFLAGS   = -pp camlp4o -g $(INCLUDES)
DEPFLAGS = -pp camlp4o

# main target
#############

NAME = wyrd

all: $(NAME)

$(NAME): $(OCAMLBEST)
	rm -f $(NAME) && ln -s $(NAME).$(OCAMLBEST) $(NAME)


# bytecode and native-code compilation
######################################

CMO = install.cmo version.cmo utility.cmo rcfile.cmo time_lang.cmo interface.cmo cal.cmo \
		remind.cmo interface_draw.cmo interface_main.cmo locale.cmo main.cmo
CMX = $(CMO:.cmo=.cmx)
CMA = str.cma unix.cma
CMXA = $(CMA:.cma=.cmxa)

COBJS = locale_wrap.o

CURSES_CMA  = curses.cma
CURSES_CMXA = curses.cmxa

GENERATED = version.ml

byte: $(NAME).byte
opt: $(NAME).opt

$(NAME).byte: $(COBJS) $(CMO)
	$(OCAMLC) $(BFLAGS) -o $@ $(CURSES_CMA) $(COBJS) $(CMA) $(CMO) 

$(NAME).opt: $(COBJS) $(CMX)
	$(OCAMLOPT) $(OFLAGS) -o $@ $(CURSES_CMXA) $(COBJS) $(CMXA) $(CMX)


VERSION=1.4.6

version.ml: Makefile
	echo "let version = \""$(VERSION)"\"" > version.ml
	echo "let date = \""`date`"\"" >> version.ml


$(CMO) $(CMX):


# The curses build script does not respond well to getting invoked
# by simultaneous processes.
.NOTPARALLEL:


# installation
##############

install-indep: 
	mkdir -p $(BINDIR)
	mkdir -p $(DESTDIR)/$(sysconfdir)
	mkdir -p $(MANDIR)/man1
	mkdir -p $(MANDIR)/man5
	$(INSTALL) -m 644 wyrdrc $(DESTDIR)/$(sysconfdir)
	$(INSTALL) -m 644 doc/wyrd.1 $(MANDIR)/man1/wyrd.1
	$(INSTALL) -m 644 doc/wyrdrc.5 $(MANDIR)/man5/wyrdrc.5

install: install-indep
	$(INSTALL) -m 755 $(NAME).$(OCAMLBEST) $(BINDIR)
	mv $(BINDIR)/$(NAME).$(OCAMLBEST) $(BINDIR)/$(NAME)

install-byte: install-indep
	$(INSTALL) -m 755 $(NAME).byte $(BINDIR)
	mv $(BINDIR)/$(NAME).byte $(BINDIR)/$(NAME)

install-opt: install-indep
	$(INSTALL) -m 755 $(NAME).opt $(BINDIR)
	mv $(BINDIR)/$(NAME).opt $(BINDIR)/$(NAME)

uninstall:
	rm -f $(BINDIR)/$(NAME)$(EXE)
	rm -f $(DESTDIR)/$(sysconfdir)/wyrdrc
	rm -f $(MANDIR)/man1/wyrd.1
	rm -f $(MANDIR)/man5/wyrdrc.5


# generic rules
###############

.SUFFIXES:


# generic build rules for toplevel directory
%.cmi : %.mli
	$(OCAMLC) -c $(BFLAGS) $<

%.cmo : %.ml
	$(OCAMLC) -c $(BFLAGS) $<

%.o : %.ml
	$(OCAMLOPT) -c $(OFLAGS) $<

%.cmx : %.ml
	$(OCAMLOPT) -c $(OFLAGS) $<

%.ml : %.mll
	$(OCAMLLEX) $<

%.ml : %.mly
	$(OCAMLYACC) -v $<

%.mli : %.mly
	$(OCAMLYACC) -v $<

%.o : %.c
	$(OCAMLC) -c $<


# Emacs tags
############

tags:
	find . -name "*.ml*" | sort -r | xargs \
	etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/and[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/type[ \t]+\([^ \t]+\)/\1/" \
              "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/val[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/module[ \t]+\([^ \t]+\)/\1/"

# vi tags
#########

vtags:
	otags -vi -o tags *.ml


# Makefile is rebuilt whenever Makefile.in or configure.ac is modified
######################################################################

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

configure: configure.ac
	autoconf 

# clean
#######

partly-clean::
	rm -f *.cm[iox] *.o *.a *~
	rm -f $(GENERATED)
	rm -f $(NAME) $(NAME).byte $(NAME).opt
	rm -f *.aux *.log $(NAME).tex $(NAME).dvi $(NAME).ps

clean:: curses-clean

dist-clean distclean:: clean
	rm -f Makefile config.cache config.log config.status install.ml


# depend
########

depend::
	$(OCAMLDEP) -pp camlp4o $(INCLUDES) *.ml *.mli > depend

include depend