Makefile

Sat, 15 Jan 2011 20:35:09 -0500

author
Thomas Harning Jr <harningt@gmail.com>
date
Sat, 15 Jan 2011 20:35:09 -0500
changeset 104
19afe60aef3d
parent 102
dc3809bf780a
child 105
9fb82ef210a3
permissions
-rw-r--r--

base: removes direct dependency on liblua since Lua modules should not directly link

74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
1 # Utilities
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
2 INSTALL = install
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
3 INSTALL_PROGRAM = $(INSTALL)
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
4 INSTALL_DATA = $(INSTALL) -m 644
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
5
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
6 # Flags
95
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
7 CFLAGS = -Wall -fpic
86
72cd8cb9b184 Makefile: Remove debug flags from compilation/linking
Matthew Wild <mwild1@gmail.com>
parents: 74
diff changeset
8 LDFLAGS = -shared
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
9
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
10 # Directories
95
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
11 LUA_INC_DIR ?= /usr/include/lua5.1
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12
95
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
13 INSTALL_DIR_LUA ?= /usr/share/lua/5.1
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
14 INSTALL_DIR_BIN ?= /usr/lib/lua/5.1
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
16 # Files
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
17 LIB = core.so
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 all:
95
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
20 $(CC) $(CFLAGS) -c -Iinclude -I$(LUA_INC_DIR) src/*.c
104
19afe60aef3d base: removes direct dependency on liblua since Lua modules should not directly link
Thomas Harning Jr <harningt@gmail.com>
parents: 102
diff changeset
21 $(CC) $(LDFLAGS) -o $(LIB) *.o -levent
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
23 install: all
101
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
24 mkdir -p $(DESTDIR)$(INSTALL_DIR_LUA)
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
25 $(INSTALL_DATA) lua/luaevent.lua $(DESTDIR)$(INSTALL_DIR_LUA)/luaevent.lua
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
26 mkdir -p $(DESTDIR)$(INSTALL_DIR_BIN)/luaevent/
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
27 $(INSTALL_PROGRAM) $(LIB) $(DESTDIR)$(INSTALL_DIR_BIN)/luaevent/$(LIB)
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 clean:
95
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
30 rm -f *.so
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
31 rm -f *.o
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32

mercurial