File: Makefile

package info (click to toggle)
slexpat 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 112 kB
  • ctags: 120
  • sloc: ansic: 776; makefile: 37
file content (67 lines) | stat: -rw-r--r-- 2,707 bytes parent folder | download | duplicates (3)
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
#---------------------------------------------------------------------------
# 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 -lexpat
INCS = $(SLANG_INC)

all: expat-module.so

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

expat.hlp: expatfuns.tm
	tmexpand -Mslhlp expatfuns.tm expat.hlp

clean:
	rm -f expat-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) expat-module.so $(DEST_MODULE_INSTALL_DIR)
install_slfiles:
	$(INSTALL) expat.sl $(DEST_SL_FILES_INSTALL_DIR)
install_hlpfiles:
	$(INSTALL) expat.hlp $(DEST_HLP_FILES_INSTALL_DIR)

install: all install_directories install_modules install_slfiles install_hlpfiles