Makefile

Sat, 15 Jan 2011 20:21:54 -0500

author
Thomas Harning Jr <harningt@gmail.com>
date
Sat, 15 Jan 2011 20:21:54 -0500
changeset 100
41a6f9a64b9e
parent 95
e29759773705
child 102
dc3809bf780a
permissions
-rw-r--r--

base: noted in CHANGELOG pending 0.3.0 release

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
e29759773705 base: updated makefile to be a little more configurable, still needs much work
Thomas Harning Jr <harningt@gmail.com>
parents: 86
diff changeset
12 LUA_LIB_DIR ?= /usr/lib
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13
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
14 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
15 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
16
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
17 # Files
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
18 LUA_LIB ?= lua5.1
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
19 LIB = core.so
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 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
22 $(CC) $(CFLAGS) -c -Iinclude -I$(LUA_INC_DIR) src/*.c
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
23 $(CC) $(LDFLAGS) -o $(LIB) *.o -L$(LUA_LIB_DIR) -l$(LUA_LIB) -levent
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
25 install: all
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
26 $(INSTALL_DATA) -D lua/luaevent.lua $(DESTDIR)$(INSTALL_DIR_LUA)/luaevent.lua
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
27 $(INSTALL_PROGRAM) -D $(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