Imported Debian patch 0.13.1-3
[pkg-lisaac.git] / Makefile
blob76e6403785b657d5d3d0724e36ddfd315a81463f
1 # This file is part of Lisaac compiler.
2 # http://isaacproject.u-strasbg.fr/
3 # LSIIT - ULP - CNRS - INRIA - FRANCE
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Available targets:
19 # ==================
20 # - all Starts the installer in automatic mode--use it if
21 # you know the installer is smart enough to compute default values, and those
22 # values suit your needs. This option is used in order to install lisaac in a
23 # non-userland way.
25 # - interactive_userland Starts the installer in userland interactive mode
27 # - install Copy all files in a proper place (non-userland)
29 # - clean Cleans the installation (non-userland)
31 # In short:
32 # =========
33 # Use : make interactive_userland for a userland installation
34 # Use : make & make install(as root) for a full system installation
35 # Use : make clean(as root) to clean up a non-userland installation
37 # TODO:
38 # =====
39 # - do a /usr/share/menu/lisaac ?
40 # - do a /usr/share/doc-base/lisaac ?
42 # Comments:
43 # =========
44 # - use default path.h or bin/path.h if userland or not
45 # - move binaries to /usr/bin/
46 # - move libraries to /usr/lib/lisaac/
47 # - move documentation to /usr/share/doc/lisaac/
48 # - move manpages to /usr/share/man/man1/
49 # - if you want to generate the documentation
50 # shorter -r -f html lib -o $(LIB)$(HTML)
52 # Bug reports:
53 # ============
54 # bug tracker system: https://gna.org/bugs/?func=additem&group=isaac
55 # mail to: Xavier Oswald <x.oswald@free.fr>
57 LIB=/usr/lib/lisaac
58 EXAMPLE=/examples
59 HTML=/html
60 BIN=/usr/bin
61 MAN=/usr/share/man/man1
62 DOC=/usr/share/doc/lisaac
63 DESTDIR=
64 CC=gcc
65 CFLAGS=-O2
67 all: bin/lisaac.c bin/shorter.c
68 @echo "#define LISAAC_DIRECTORY \"$(DESTDIR)$(LIB)\"" > bin/path.h
69 $(CC) $(CFLAGS) bin/lisaac.c -o bin/lisaac
70 $(CC) $(CFLAGS) bin/shorter.c -o bin/shorter
72 interactive_userland: install_lisaac.c
73 @echo - Lisaac compiler installation For Unix / Linux / Windows -
74 @echo Please wait...
75 $(CC) $(CFLAGS) install_lisaac.c -o install_lisaac
76 @echo - please run ./install_lisaac to finish the installation
78 install:
79 mkdir -p $(DESTDIR)$(LIB)
80 mkdir -p $(DESTDIR)$(BIN)
81 mkdir -p $(DESTDIR)$(MAN)
82 mkdir -p $(DESTDIR)$(DOC)$(HTML)
83 mkdir -p $(DESTDIR)$(DOC)$(EXAMPLE)
84 cp bin/lisaac $(DESTDIR)$(BIN)
85 cp bin/shorter $(DESTDIR)$(BIN)
86 cp path.li $(DESTDIR)$(LIB)
87 cp -rf lib/ $(DESTDIR)$(LIB)
88 cp -rf lib_os/ $(DESTDIR)$(LIB)
89 cp -rf example/* $(DESTDIR)$(DOC)$(EXAMPLE)
90 cp -rf shorter/ $(DESTDIR)$(LIB)
91 cp -rf manpage/*.gz $(DESTDIR)$(MAN)
92 #$(DESTDIR)$(BIN)/shorter -r -f html lib -o $(DESTDIR)$(DOC)$(HTML)
94 clean:
95 rm -rf bin/lisaac
96 rm -rf bin/shorter
97 rm -rf bin/path.h
98 rm -rf $(DESTDIR)$(BIN)/lisaac
99 rm -rf $(DESTDIR)$(BIN)/shorter
100 rm -rf $(DESTDIR)$(LIB)
101 rm -rf $(DESTDIR)$(DOC)
102 rm -rf $(DESTDIR)$(MAN)/lisaac.1.gz
103 rm -rf $(DESTDIR)$(MAN)/shorter.1.gz