aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Makefile
blob: 22f299adeb07a0225260d54ae7a000c05175c06e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.

.SUFFIXES: .c .o .h .a

INCLUDEDIRS=-Iscintilla-st/include -Ilua/include
ifdef DEBUG
CXXFLAGS=-DDEBUG -g -DGTK -DSCI_LEXER -W -Wall
else
CXXFLAGS=-DNDEBUG -O -DGTK -DSCI_LEXER -W -Wall
endif
GTKFLAGS=$(shell pkg-config --cflags gtk+-2.0)
GTKLIBS=$(shell pkg-config --libs gtk+-2.0 gthread-2.0)
EXPORTLUASYMS=-rdynamic -Wl,--retain-symbols-file -Wl,lua.sym

ifndef X86_64
ARCHDIR=lib32
else
ARCHDIR=x86_64
endif
GTKSO=../$(ARCHDIR)/core/gtk.so

LUA_OBJS = lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o \
  ltable.o ltm.o lundump.o lvm.o lzio.o \
  lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o ltablib.o \
  lstrlib.o loadlib.o loslib.o linit.o \
  lpeg.o lfs.o

all: textadept

.c.o:
	g++ $(GTKFLAGS) $(INCLUDEDIRS) $(CXXFLAGS) -c $< -o $@
$(LUA_OBJS): lua/src/*.c
	gcc $(INCLUDEDIRS) -DLUA_USE_LINUX $(CXXFLAGS) -c lua/src/*.c
textadept:\
  textadept.o lua_interface.o $(LUA_OBJS) \
  scintilla-st/gtk/LexLPeg.o scintilla-st/bin/scintilla.a
	g++ $(GTKLIBS) $(EXPORTLUASYMS) -DGTK $^ -o $@
	cp $(GTKSO) ../core/
clean:
	rm textadept *.o