File: Makefile

package info (click to toggle)
slsqlite 0.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 88 kB
  • ctags: 88
  • sloc: ansic: 829; makefile: 39
file content (71 lines) | stat: -rw-r--r-- 2,814 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#---------------------------------------------------------------------------
# Installation Directories
#---------------------------------------------------------------------------
prefix = /usr/local
exec_prefix = ${prefix}
MODULE_INSTALL_DIR = ${exec_prefix}/lib/slang/v2/modules
SL_FILES_INSTALL_DIR = ${prefix}/share/slsh/local-packages
HLP_FILES_INSTALL_DIR = $(SL_FILES_INSTALL_DIR)/help

#---------------------------------------------------------------------------
# DESTDIR is designed to facilitate making packages.  Normally it is empty
#---------------------------------------------------------------------------
DESTDIR =
DEST_MODULE_INSTALL_DIR = $(DESTDIR)$(MODULE_INSTALL_DIR)
DEST_SL_FILES_INSTALL_DIR = $(DESTDIR)$(SL_FILES_INSTALL_DIR)
DEST_HLP_FILES_INSTALL_DIR = $(DESTDIR)$(HLP_FILES_INSTALL_DIR)

#---------------------------------------------------------------------------
# Location of the S-Lang library and its include file
#---------------------------------------------------------------------------
SLANG_INC	= -I/usr/local/include
SLANG_LIB	= -L/usr/local/lib -lslang

#---------------------------------------------------------------------------
# C Compiler to create a shared library
#---------------------------------------------------------------------------
CC_SHARED 	= $(CC) $(CFLAGS) -shared -Wall -fPIC

#---------------------------------------------------------------------------
# Misc Programs required for installation
#---------------------------------------------------------------------------
INSTALL		= /usr/bin/install -m 644
MKINSDIR        = /usr/bin/install -d
#---------------------------------------------------------------------------
# You shouldn't need to edit anything below this line
#---------------------------------------------------------------------------

LIBS = $(SLANG_LIB) -lm -lsqlite3
INCS = $(SLANG_INC)

all: sqlite-module.so

sqlite-module.so: sqlite-module.c
	$(CC_SHARED) $(INCS) -g sqlite-module.c -o sqlite-module.so $(LIBS)

sqlite.o: sqlite-module.c
	gcc $(CFLAGS) $(INCS) -O2 -c -g sqlite-module.c -o sqlite.o

sqlite.hlp: sqlitefuns.tm
	tmexpand -Mslhlp sqlitefuns.tm sqlite.hlp


clean:
	rm -f sqlite-module.so *.o

#---------------------------------------------------------------------------
# Installation Rules
#---------------------------------------------------------------------------
install_directories:
	$(MKINSDIR) $(DEST_MODULE_INSTALL_DIR)
	$(MKINSDIR) $(DEST_SL_FILES_INSTALL_DIR)
	$(MKINSDIR) $(DEST_HLP_FILES_INSTALL_DIR)

install_modules:
	$(INSTALL) sqlite-module.so $(DEST_MODULE_INSTALL_DIR)
install_slfiles:
	$(INSTALL) sqlite.sl $(DEST_SL_FILES_INSTALL_DIR)
install_hlpfiles:
	$(INSTALL) sqlite.hlp $(DEST_HLP_FILES_INSTALL_DIR)

install: all install_directories install_modules install_slfiles install_hlpfiles