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
tmueller@0
     1
tmueller@0
     2
INCL = -I.
tmueller@0
     3
WARN = -Wall
tmueller@0
     4
#DEBUG = -g
tmueller@0
     5
OPT = -O2
tmueller@0
     6
tmueller@251
     7
LUA_LIB ?= /usr/local/lib/lua/5.1
tmueller@251
     8
LUA_SHARE ?= /usr/local/share/lua/5.1
tmueller@251
     9
LUA_MODULES = tek/lib/luahtml.so tek/lib/posix.so
tmueller@0
    10
tmueller@0
    11
help:
tmueller@0
    12
	@echo
tmueller@238
    13
	@echo "Targets"
tmueller@0
    14
	@echo "-------------------------------------------------------------------------------"
tmueller@0
    15
	@echo "help .......... This help"
tmueller@0
    16
	@echo "modules ....... Build modules"
tmueller@251
    17
	@echo "install ....... Install modules [LUA_SHARE: $(LUA_SHARE)]"
tmueller@0
    18
	@echo
tmueller@238
    19
	@echo "fastcgi-run ... Run as FastCGI external server"
tmueller@238
    20
	@echo "                See loona_fastcgi.lua for configuration options"
tmueller@198
    21
	@echo
tmueller@0
    22
	@echo "NOTE .......... Modules can reside locally under cgi-bin."
tmueller@0
    23
	@echo "                An installation is not strictly required."
tmueller@0
    24
	@echo
tmueller@0
    25
tmueller@0
    26
.c.o:
tmueller@211
    27
	$(CC) $(INCL) $(WARN) $(DEBUG) $(OPT) -fPIC -DPIC -c $? -o $@
tmueller@0
    28
tmueller@251
    29
modules: $(LUA_MODULES)
tmueller@0
    30
tmueller@0
    31
all: modules
tmueller@0
    32
tmueller@251
    33
install: $(LUA_MODULES)
tmueller@251
    34
	-install -d $(LUA_LIB)/tek/lib
tmueller@251
    35
	-install -d $(LUA_SHARE)/tek/app
tmueller@251
    36
	-install -d $(LUA_SHARE)/tek/lib
tmueller@251
    37
	-install -d $(LUA_SHARE)/tek/class/cgi
tmueller@251
    38
	-install -d $(LUA_SHARE)/tek/class/loona
tmueller@251
    39
	-install -s tek/lib/posix.so tek/lib/luahtml.so $(LUA_LIB)/tek/lib
tmueller@251
    40
	-luac -s -o $(LUA_SHARE)/tek/lib.lua tek/lib.lua
tmueller@251
    41
	-luac -s -o $(LUA_SHARE)/tek/lib/debug.lua tek/lib/debug.lua
tmueller@251
    42
	-luac -s -o $(LUA_SHARE)/tek/app/loona.lua tek/app/loona.lua
tmueller@251
    43
	-luac -s -o $(LUA_SHARE)/tek/class.lua tek/class.lua
tmueller@251
    44
	-luac -s -o $(LUA_SHARE)/tek/class/cgi.lua tek/class/cgi.lua
tmueller@251
    45
	-luac -s -o $(LUA_SHARE)/tek/class/fastcgi.lua tek/class/fastcgi.lua
tmueller@251
    46
	-luac -s -o $(LUA_SHARE)/tek/class/cgi/post.lua tek/class/cgi/post.lua
tmueller@251
    47
	-luac -s -o $(LUA_SHARE)/tek/class/cgi/request.lua tek/class/cgi/request.lua
tmueller@251
    48
	-luac -s -o $(LUA_SHARE)/tek/class/loona.lua tek/class/loona.lua
tmueller@251
    49
	-luac -s -o $(LUA_SHARE)/tek/class/loona/buffer.lua tek/class/loona/buffer.lua
tmueller@251
    50
	-luac -s -o $(LUA_SHARE)/tek/class/markup.lua tek/class/markup.lua
tmueller@251
    51
	-luac -s -o $(LUA_SHARE)/tek/class/loona/util.lua tek/class/loona/util.lua
tmueller@0
    52
tmueller@188
    53
tek/lib/luahtml.so: tek/lib/luahtml.o
tmueller@0
    54
	$(CC) $^ -shared -o $@ $(LIBS)
tmueller@0
    55
tmueller@251
    56
tek/lib/posix.so: tek/lib/posix.o
tmueller@0
    57
	$(CC) $^ -shared -o $@ $(LIBS)
tmueller@0
    58
tmueller@0
    59
clean:
tmueller@251
    60
	-rm tek/lib/*.so tek/lib/*.o
tmueller@198
    61
tmueller@198
    62
fastcgi-run:
tmueller@198
    63
	./loona_fastcgi.lua