removed apps
[luayats.git] / Makefile
blobbab85b8eb1d2dd76c887a86cdf271bb511c5a200
2 # Makefile for Yats
4 include config
6 topdir=.
7 TARGETLUA=bin/luayats
8 TARGET=bin/luayats-bin$(EXE)
9 YLIBS = $(addsuffix .a, $(addprefix lib/lib, $(MODULES)))
10 DOCDIR = $(topdir)/doc
11 LUADOCDIR = $(DOCDIR)/lua
12 LUASRCS = $(addprefix yats/, $(addsuffix .lua, $(LUAMODULES)))
13 LUADOCS = $(addprefix $(LUADOCDIR), $(LUASRCS:.lua=.html)) $(LUADOCDIR)/index.html \
14 $(LUADOCDIR)/luadoc.css
15 CPPDOCDIR = $(DOCDIR)/cpp
16 SHELL = /bin/sh
17 TAGNAME=LUAYATS-$(MAJOR)_$(MINOR)
18 EXPORTDIR=$(HOME)/exports
19 DISTNAME=luayats-$(MAJOR).$(MINOR)
20 DISTARCH=$(DISTNAME).tar.gz
21 DISTLATESTNAME=luayats-latest-$(MAJOR).$(MINOR)
22 DISTLATESTARCH=$(DISTLATESTNAME).tar.gz
23 SVNMODULE=luayats-$(MAJOR).0
24 INSTALL_ROOT=/usr/local/share/luayats
25 ifeq ($(SYSTEM), Cygwin)
26 RCOBJS=$(topdir)/src/lua/yats.ro
27 else
28 RCOBJS=
29 endif
30 .PHONY: all libs clean uclean doc-clean depend dist-svn dist-git dist tag doc doxy doxy-clean
31 .PHONY: install-code install-doc install-examples install
32 .PHONY: uninstall-code uninstall-doc uninstall-examples uninstall
34 all: libs $(TARGETLUA)
36 include rules.mk
38 libs:
39 mkdir -p ./lib
40 for i in $(MODULES); do $(MAKE) -C src/$$i lib; done
42 $(TARGET): $(YLIBS) $(RCOBJS)
43 mkdir -p bin
44 $(CC) $(LDFLAGS) $(RCOBJS) $(YLIBS) $(YLIBS) $(LIBDIR) $(LIBS) $(LUASLIBS) -o $@
46 $(TARGETLUA): $(TARGET)
47 cd bin;ln -f -s ../yats/luayats.lua luayats;chmod +x ../yats/luayats.lua
49 clean:
50 for i in $(MODULES); do $(MAKE) -C src/$$i lib-clean; done
51 rm -f $(TARGET) *.stackdump *~
52 rm -f $(TARGETLUA)
53 rm -f lua/*~
54 rm -f gmon.out
55 rm -f $(RCOBJS)
57 uclean:
58 for i in $(MODULES); do $(MAKE) -C src/$$i lib-uclean; done
59 rm -f $(TARGET) *.stackdump *~ examples/*~
60 rm -f $(TARGETLUA)
61 rm -f src/lua/yats_bind.[ch]
62 rm -f `find . -name "semantic.cache"`
63 rm -rf lib bin
64 rm -rf `find . -name "*~"`
66 doc-clean::
67 rm -rf $(LUADOCDIR)
69 depend:
70 for i in $(MODULES); do $(MAKE) -C src/$$i lib-depend; done
72 luadoc::
73 mkdir -p $(LUADOCDIR)
74 luadoc --nomodules -d $(LUADOCDIR) $(LUASRCS)
76 doc::
77 $(MAKE) luadoc
78 $(MAKE) doxy
79 $(MAKE) luadocindex
80 $(MAKE) refindex
82 cdoc doxy::
83 mkdir -p $(CPPDOCDIR)
84 doxygen doc/doxygen.conf
86 cdoc-clean doxy-clean::
87 rm -rf $(CPPDOCDIR)
89 refindex:: $(CPPDOCDIR)/luayats.xml
90 luayats-bin -l iuplua yats/luayats.lua -R doc/ldocindex.lua -d $(CPPDOCDIR)/luayats.xml -o doc/refindex.html
91 # luayats -R doc/ldocindex.lua -d $(CPPDOCDIR)/luayats.xml -o doc/refindex.html
93 luadocindex:
94 luayats -l doc/lua/files/yats -o doc/ldocindex.lua
96 info::
97 luayats -i a > INFO
99 tag::
100 echo "Using GIT - no tags yet"
102 taglatest::
103 echo "Using GIT - no tags yet"
105 distrelease-svn::
106 svn export $(REPOSITORY)/$(SVNMODULE)/tags/release-$(MAJOR).$(MINOR) $(EXPORTDIR)/$(DISTNAME)
107 cd $(EXPORTDIR); tar -cvzf $(DISTARCH) $(DISTNAME)/*
108 rm -rf $(EXPORTDIR)/$(DISTNAME)
110 dist-svn:
111 svn export $(REPOSITORY)/$(SVNMODULE)/trunk $(EXPORTDIR)/$(DISTNAME)
112 cd $(EXPORTDIR); tar -cvzf $(DISTARCH) $(DISTNAME)/*
113 rm -rf $(EXPORTDIR)/$(DISTNAME)
115 dist-git:
116 mkdir -p $(EXPORTDIR)
117 git archive --format=tar --prefix=$(DISTNAME)/ HEAD | gzip >$(EXPORTDIR)/$(DISTARCH)
119 dist: dist-git
120 testresult::
121 LUAYATSTESTMODE=w luayats -n examples/test-all.lua
123 test::
124 LUAYATSTESTMODE=t luayats -n examples/test-all.lua
126 install-code:
127 mkdir -p /usr/local/bin
128 cp -f $(TARGET) /usr/local/bin
129 cp -f yats/luayats.lua /usr/local/bin/luayats
130 chmod +x /usr/local/bin/luayats
131 mkdir -p $(INSTALL_ROOT)
132 cp -rf yats $(INSTALL_ROOT)
134 install-doc:
135 mkdir -p $(INSTALL_ROOT)/doc
136 cd doc; cp -rf * $(INSTALL_ROOT)/doc
137 mkdir -p /usr/local/share/doc
138 cd /usr/local/share/doc; ln -f -s $(INSTALL_ROOT)/doc luayats
140 install-examples:
141 mkdir -p $(INSTALL_ROOT)/examples
142 cd examples; cp -rf * $(INSTALL_ROOT)/examples
144 install: install-code install-doc
146 uninstall-code:
147 rm -rf /usr/local/bin/$(TARGET)
148 rm -rf /usr/local/bin/luayats
149 rm -rf $(INSTALL_ROOT)/yats
151 uninstall-doc:
152 rm -rf /$(INSTALL_ROOT)/doc
153 rm -f /usr/local/share/doc/luayats
155 uninstall-examples:
156 rm -rf $(INSTALL_ROOT)/examples
158 uninstall: uninstall-code uninstall-doc uninstall-examples
159 rm -rf $(INSTALL_ROOT)