diff options
author | Dwayne Bent <dbb.1@liqd.org> | 2010-01-18 13:16:06 -0500 |
---|---|---|
committer | Dwayne Bent <dbb.1@liqd.org> | 2010-01-18 13:16:06 -0500 |
commit | 6da15fb55e02f36b8b38f659466fa0f213392179 (patch) | |
tree | a66f470fb2f288f3a491f2aceee9b1b7d7d2c153 | |
parent | 555962f4618026d8da25b729994f22d0a8fcac23 (diff) | |
download | luaevent-prosody-6da15fb55e02f36b8b38f659466fa0f213392179.tar.gz luaevent-prosody-6da15fb55e02f36b8b38f659466fa0f213392179.zip |
Makefile: Make makefile a bit more generic
-rw-r--r-- | Makefile | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -1,19 +1,30 @@ +# Utilities +INSTALL = install +INSTALL_PROGRAM = $(INSTALL) +INSTALL_DATA = $(INSTALL) -m 644 + +# Flags +CFLAGS = -g -O0 -c -Wall -fpic +LDFLAGS = -g -shared + +# Directories LUA_INC_DIR=/usr/include/lua5.1 LUA_LIB_DIR=/usr/lib INSTALL_DIR_LUA=/usr/share/lua/5.1 INSTALL_DIR_BIN=/usr/lib/lua/5.1 +# Files +LUA_LIB = lua5.1 +LIB = core.so all: - gcc -g -O0 -c -Wall -fpic -Iinclude -I$(LUA_INC_DIR) src/*.c - gcc -g -shared -fpic -o core.so *.o -L$(LUA_LIB_DIR) -llua5.1 -levent - -install: - install -d $(INSTALL_DIR_LUA) - install lua/luaevent.lua $(INSTALL_DIR_LUA)/ - install -d $(INSTALL_DIR_BIN)/luaevent - install core.so $(INSTALL_DIR_BIN)/luaevent/core.so + $(CC) $(CFLAGS) -Iinclude -I$(LUA_INC_DIR) src/*.c + $(CC) $(LDFLAGS) -o $(LIB) *.o -L$(LUA_LIB_DIR) -l$(LUA_LIB) -levent + +install: all + $(INSTALL_DATA) -D lua/luaevent.lua $(DESTDIR)$(INSTALL_DIR_LUA)/luaevent.lua + $(INSTALL_PROGRAM) -D $(LIB) $(DESTDIR)$(INSTALL_DIR_BIN)/luaevent/$(LIB) clean: rm *.so |