summaryrefslogtreecommitdiff
path: root/support/syngen/src/Makefile
blob: 70b3bfb37b53e506065d824054f04099f77c5e85 (plain)
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
# Compilation options
CSLC=cslc
CSLOPT=cslopt
CSLDEP=csldep
INCLUDES=
CSLFLAGS=$(INCLUDES)
CSLOPTFLAGS=$(INCLUDES)

# The directory where the public executable will be installed
BINDIR=/usr/local/bin

# The manual section where the manual pages will be installed
MANEXT=1

# The directory where the manual pages will be installed
MANDIR=/usr/local/man/man$(MANEXT)

##### End of configuration section


# The commands for bytecode compilation

# The list of object files in bytecode format
SYNGEN_BYTE_OBJS=lexer.cmo parser.cmo picture.cmo boxes.cmo latexcode.cmo\
                 main.cmo

byte:   $(SYNGEN_BYTE_OBJS)
	$(CSLC) -o syngen $(CSLFLAGS) $(SYNGEN_BYTE_OBJS)


# The commands for native-code compilation

# The list of object files in native-code format
SYNGEN_NATIVE_OBJS=lexer.cmx parser.cmx picture.cmx boxes.cmx\
                   latexcode.cmx main.cmx

native: $(SYNGEN_NATIVE_OBJS)
	$(CSLOPT) -o syngen $(CSLOPTFLAGS) $(SYNGEN_NATIVE_OBJS)


# Common rules

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(CSLC) $(CSLFLAGS) -c $<

.mli.cmi:
	$(CSLC) $(CSLFLAGS) -c $<

.ml.cmx:
	$(CSLOPT) $(CSLOPTFLAGS) -c $<


# Clean up

clean:
	rm -f *.cm[iox] *.o *~


# Installation

install:
	cp syngen $(BINDIR)/syngen
	cp syngen.m $(MANDIR)/syngen.$(MANEXT)


# Dependencies

depend:
	$(CSLDEP) $(INCLUDES) *.mli *.ml > depend

include depend