Makefile

Wed, 03 Mar 2010 18:19:20 -0600

author
James Snyder <jbsnyder@fanplastic.org>
date
Wed, 03 Mar 2010 18:19:20 -0600
changeset 101
f5369fe8f107
parent 88
0e346184aa9d
child 102
dc3809bf780a
permissions
-rw-r--r--

Changes to compile on OS X.

- BSD version of install doesn't have -D flag
- stdlib.h should include malloc defs (malloc.h is obsolete)

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
88
0e346184aa9d Makefile: Reduce optimisation to -O2 from -O3
Matthew Wild <mwild1@gmail.com>
parents: 86
diff changeset
7 CFLAGS = -O2 -c -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
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 LUA_INC_DIR=/usr/include/lua5.1
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 LUA_LIB_DIR=/usr/lib
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 INSTALL_DIR_LUA=/usr/share/lua/5.1
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 INSTALL_DIR_BIN=/usr/lib/lua/5.1
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
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
18 LUA_LIB = lua5.1
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:
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
22 $(CC) $(CFLAGS) -Iinclude -I$(LUA_INC_DIR) src/*.c
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
101
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
26 mkdir -p $(DESTDIR)$(INSTALL_DIR_LUA)
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
27 $(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
28 mkdir -p $(DESTDIR)$(INSTALL_DIR_BIN)/luaevent/
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
29 $(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
30
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 clean:
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 rm *.so
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 rm *.o
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34

mercurial