Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (121 sloc) 2.96 KB
# @configure_input@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CPPFLAGS += @CPPFLAGS_ADD@
LDFLAGS = @LDFLAGS@
SHARED = @SHARED@
LIBS = @LIBS@
INSTALL = @INSTALL@
SED = @SED@
STRIP = @STRIP@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
datarootdir = @datarootdir@
pkgconfigdir = @pkgconfigdir@
lmoddir = @lmoddir@
cmoddir = @cmoddir@
headers = @headers@
objects = @objects@
llibs = \
lem/repl.lua \
lem/parsers.lua \
lem/io.lua \
lem/io/queue.lua \
lem/signal.lua \
lem/lfs.lua \
lem/http.lua \
lem/http/response.lua \
lem/http/server.lua \
lem/http/client.lua \
lem/queue.lua \
lem/hathaway.lua
clibs = \
lem/utils.so \
lem/parsers/core.so \
lem/io/core.so \
lem/signal/core.so \
lem/lfs/core.so \
lem/http/core.so
ifdef V
E=@\#
Q=
else
E=@echo
Q=@
endif
.PHONY: all strip install clean
all: CPPFLAGS += -DNDEBUG
all: bin/lem lem.pc $(clibs)
debug: bin/lem lem.pc $(clibs)
bin/libev.o: CFLAGS += -w
include/lem.h: lua/luaconf.h
bin/lua.o: lua/luaconf.h
bin/lem.o: include/lem.h bin/pool.c
bin/lem.o: CPPFLAGS += -D'LEM_LDIR="$(lmoddir)/"'
lem/io/core.so: include/lem-parsers.h \
lem/io/file.c \
lem/io/stream.c \
lem/io/server.c \
lem/io/unix.c \
lem/io/tcp.c
lem/parsers/core.so: include/lem-parsers.h
lem/http/core.so: include/lem-parsers.h
%.o: %.c
$E ' CC $@'
$Q$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
bin/lem: $(objects)
$E ' LD $@'
$Q$(CC) $^ -o $@ -rdynamic $(LDFLAGS) $(LIBS)
%.so: %.c include/lem.h
$E ' CCLD $@'
$Q$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -nostartfiles $(SHARED) $< -o $@ $(LDFLAGS)
lua/luaconf.h: lua/luaconf.h.in
$E ' SED > $@'
$Q$(SED) \
-e 's|@lmoddir[@]|$(lmoddir)|' \
-e 's|@cmoddir[@]|$(cmoddir)|' \
$< > $@
lem.pc: lem.pc.in
$E ' SED > $@'
$Q$(SED) \
-e 's|@lmoddir[@]|$(lmoddir)|' \
-e 's|@cmoddir[@]|$(cmoddir)|' \
-e 's|@includedir[@]|$(includedir)|' \
-e 's|@Lua_CFLAGS[@]|@Lua_CFLAGS@|' \
$< > $@
%-strip: %
$E ' STRIP $<'
$Q$(STRIP) $(STRIP_ARGS) $<
strip: bin/lem-strip $(clibs:%=%-strip)
$(DESTDIR)$(bindir)/%: bin/%
$E ' INSTALL $@'
$Q$(INSTALL) -d $(dir $@)
$Q$(INSTALL) -m 755 $< $@
$(DESTDIR)$(includedir)/lem/%: lua/%
$E ' INSTALL $@'
$Q$(INSTALL) -d $(dir $@)
$Q$(INSTALL) -m 644 $< $@
$(DESTDIR)$(includedir)/lem/%: libev/%
$E ' INSTALL $@'
$Q$(INSTALL) -d $(dir $@)
$Q$(INSTALL) -m 644 $< $@
$(DESTDIR)$(includedir)/lem/%: include/%
$E ' INSTALL $@'
$Q$(INSTALL) -d $(dir $@)
$Q$(INSTALL) -m 644 $< $@
$(DESTDIR)$(lmoddir)/% $(DESTDIR)$(cmoddir)/% $(DESTDIR)$(pkgconfigdir)/%: %
$E ' INSTALL $@'
$Q$(INSTALL) -d $(dir $@)
$Q$(INSTALL) -m 644 $< $@
install: \
$(DESTDIR)$(bindir)/lem \
$(DESTDIR)$(pkgconfigdir)/lem.pc \
$(headers:%=$(DESTDIR)$(includedir)/lem/%) \
$(llibs:%=$(DESTDIR)$(lmoddir)/%) \
$(clibs:%=$(DESTDIR)$(cmoddir)/%)
clean:
rm -f bin/lem bin/*.o $(clibs) lua/luaconf.h lem.pc
Jump to Line
Something went wrong with that request. Please try again.