cgi-bin/Makefile
author Timm S. Mueller <tmueller@neoscientists.org>
Fri, 24 Oct 2008 01:35:27 +0200
changeset 251 2de5931b723d
parent 241 c6c81629f54e
permissions -rw-r--r--
tek.os.posix has been moved to tek.lib.posix, module initialization procedure
simplified, added statvfs() under Linux
     1 
     2 INCL = -I.
     3 WARN = -Wall
     4 #DEBUG = -g
     5 OPT = -O2
     6 
     7 LUA_LIB ?= /usr/local/lib/lua/5.1
     8 LUA_SHARE ?= /usr/local/share/lua/5.1
     9 LUA_MODULES = tek/lib/luahtml.so tek/lib/posix.so
    10 
    11 help:
    12 	@echo
    13 	@echo "Targets"
    14 	@echo "-------------------------------------------------------------------------------"
    15 	@echo "help .......... This help"
    16 	@echo "modules ....... Build modules"
    17 	@echo "install ....... Install modules [LUA_SHARE: $(LUA_SHARE)]"
    18 	@echo
    19 	@echo "fastcgi-run ... Run as FastCGI external server"
    20 	@echo "                See loona_fastcgi.lua for configuration options"
    21 	@echo
    22 	@echo "NOTE .......... Modules can reside locally under cgi-bin."
    23 	@echo "                An installation is not strictly required."
    24 	@echo
    25 
    26 .c.o:
    27 	$(CC) $(INCL) $(WARN) $(DEBUG) $(OPT) -fPIC -DPIC -c $? -o $@
    28 
    29 modules: $(LUA_MODULES)
    30 
    31 all: modules
    32 
    33 install: $(LUA_MODULES)
    34 	-install -d $(LUA_LIB)/tek/lib
    35 	-install -d $(LUA_SHARE)/tek/app
    36 	-install -d $(LUA_SHARE)/tek/lib
    37 	-install -d $(LUA_SHARE)/tek/class/cgi
    38 	-install -d $(LUA_SHARE)/tek/class/loona
    39 	-install -s tek/lib/posix.so tek/lib/luahtml.so $(LUA_LIB)/tek/lib
    40 	-luac -s -o $(LUA_SHARE)/tek/lib.lua tek/lib.lua
    41 	-luac -s -o $(LUA_SHARE)/tek/lib/debug.lua tek/lib/debug.lua
    42 	-luac -s -o $(LUA_SHARE)/tek/app/loona.lua tek/app/loona.lua
    43 	-luac -s -o $(LUA_SHARE)/tek/class.lua tek/class.lua
    44 	-luac -s -o $(LUA_SHARE)/tek/class/cgi.lua tek/class/cgi.lua
    45 	-luac -s -o $(LUA_SHARE)/tek/class/fastcgi.lua tek/class/fastcgi.lua
    46 	-luac -s -o $(LUA_SHARE)/tek/class/cgi/post.lua tek/class/cgi/post.lua
    47 	-luac -s -o $(LUA_SHARE)/tek/class/cgi/request.lua tek/class/cgi/request.lua
    48 	-luac -s -o $(LUA_SHARE)/tek/class/loona.lua tek/class/loona.lua
    49 	-luac -s -o $(LUA_SHARE)/tek/class/loona/buffer.lua tek/class/loona/buffer.lua
    50 	-luac -s -o $(LUA_SHARE)/tek/class/markup.lua tek/class/markup.lua
    51 	-luac -s -o $(LUA_SHARE)/tek/class/loona/util.lua tek/class/loona/util.lua
    52 
    53 tek/lib/luahtml.so: tek/lib/luahtml.o
    54 	$(CC) $^ -shared -o $@ $(LIBS)
    55 
    56 tek/lib/posix.so: tek/lib/posix.o
    57 	$(CC) $^ -shared -o $@ $(LIBS)
    58 
    59 clean:
    60 	-rm tek/lib/*.so tek/lib/*.o
    61 
    62 fastcgi-run:
    63 	./loona_fastcgi.lua