File: Makefile

package info (click to toggle)
slexpat 0.5.0-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 180 kB
  • sloc: ansic: 776; makefile: 109
file content (69 lines) | stat: -rw-r--r-- 2,894 bytes parent folder | download
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
#---------------------------------------------------------------------------
# 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) $(CPPFLAGS) $(INCS) $(LDFLAGS) 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 install-directories-stamp

#---------------------------------------------------------------------------
# Installation Rules
#---------------------------------------------------------------------------
install-directories-stamp: install_directories
	touch install-directories-stamp
install_directories:
	$(MKINSDIR) $(DEST_MODULE_INSTALL_DIR)
	$(MKINSDIR) $(DEST_SL_FILES_INSTALL_DIR)
	$(MKINSDIR) $(DEST_HLP_FILES_INSTALL_DIR)

install_modules: install-directories-stamp
	$(INSTALL) expat-module.so $(DEST_MODULE_INSTALL_DIR)
install_slfiles: install-directories-stamp
	$(INSTALL) expat.sl $(DEST_SL_FILES_INSTALL_DIR)
install_hlpfiles: install-directories-stamp
	$(INSTALL) expat.hlp $(DEST_HLP_FILES_INSTALL_DIR)

install: all install_modules install_slfiles install_hlpfiles