Makefile

Mon, 16 Jan 2012 01:53:45 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 16 Jan 2012 01:53:45 +0000
changeset 107
f937d449075d
parent 105
9fb82ef210a3
permissions
-rw-r--r--

Merge with upstream

105
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
1 .PHONY: all install clean dist dist-all dist-bzip2 dist-gzip dist-zip
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
2
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
3 DIST_DIR=dist
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
4
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
5 # Utilities
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
6 INSTALL = install
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
7 INSTALL_PROGRAM = $(INSTALL)
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
8 INSTALL_DATA = $(INSTALL) -m 644
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 # 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
11 CFLAGS = -Wall -fpic
86
72cd8cb9b184 Makefile: Remove debug flags from compilation/linking
Matthew Wild <mwild1@gmail.com>
parents: 74
diff changeset
12 LDFLAGS = -shared
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
13
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
14 # 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
15 LUA_INC_DIR ?= /usr/include/lua5.1
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16
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
17 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
18 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
19
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
20 # Files
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
21 LIB = core.so
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 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
24 $(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
25 $(CC) $(LDFLAGS) -o $(LIB) *.o -levent
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26
105
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
27 dist dist-all: distdir dist-bzip2 dist-gzip dist-zip
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
28
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
29 distdir:
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
30 mkdir -p $(DIST_DIR)
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
31
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
32 VERSION=luaevent-$(shell git describe --abbrev=4 HEAD 2>/dev/null)
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
33 dist-bzip2: distdir
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
34 git archive --format=tar --prefix=$(VERSION)/ HEAD | bzip2 -9v > $(DIST_DIR)/$(VERSION).tar.bz2
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
35 dist-gzip: distdir
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
36 git archive --format=tar --prefix=$(VERSION)/ HEAD | gzip -9v > $(DIST_DIR)/$(VERSION).tar.gz
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
37 dist-zip: distdir
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
38 git archive --format=zip --prefix=$(VERSION)/ HEAD > $(DIST_DIR)/$(VERSION).zip
9fb82ef210a3 base: adds distribution archive generation functionality to Makefile
Thomas Harning Jr <harningt@gmail.com>
parents: 104
diff changeset
39
74
8f1e69d846c1 Makefile: Make makefile a bit more generic
Dwayne Bent <dbb.1@liqd.org>
parents: 73
diff changeset
40 install: all
101
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
41 mkdir -p $(DESTDIR)$(INSTALL_DIR_LUA)
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
42 $(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
43 mkdir -p $(DESTDIR)$(INSTALL_DIR_BIN)/luaevent/
f5369fe8f107 Changes to compile on OS X.
James Snyder <jbsnyder@fanplastic.org>
parents: 88
diff changeset
44 $(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
45
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 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
47 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
48 rm -f *.o
73
e9b909b391c3 Makefile: Added basic Makefile for standard make
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49

mercurial