File: Makefile

package info (click to toggle)
tcm 2.20+TSQD-6
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 22,768 kB
  • sloc: ansic: 78,527; sh: 3,618; makefile: 1,345; perl: 753; yacc: 558; lex: 257
file content (145 lines) | stat: -rwxr-xr-x 3,908 bytes parent folder | download | duplicates (6)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This Makefile requires GNU make (gmake).

SHELL=/bin/sh

# change this if you want to install it in a different place
ifndef $(TCM_INSTALL_DIR)
	TCM_INSTALL_DIR=$TCM_HOME
endif

# the current version.
TCM_VERSION=2.20

# just a guess (flags should indicate recursiveness, permission
# keeping and links should stay links).
TCM_INSTALL_CMD = /bin/cp -fpr


ifndef TCM_INSTALL_LIB
	TCM_INSTALL_LIB=$(TCM_INSTALL_DIR)/lib/
endif

ifndef CONFIG_INSTALL
	CONFIG_INSTALL=$(TCM_INSTALL_LIB)
endif

ifndef TCM_INSTALL_DOC
	TCM_INSTALL_DOC=$(TCM_INSTALL_DIR)/doc/
endif

ifndef TCM_INSTALL_SHARE
	TCM_INSTALL_SHARE=$(TCM_INSTALL_LIB)
endif

ifndef TCM_INSTALL_MAN
	TCM_INSTALL_MAN=$(TCM_INSTALL_DIR)/man/
endif

MFLAGS += TCM_INSTALL_DIR='$(TCM_INSTALL_DIR)' TCM_INSTALL_LIB='$(TCM_INSTALL_LIB)' CONFIG_INSTALL='$(CONFIG_INSTALL)' TCM_INSTALL_DOC='$(TCM_INSTALL_DOC)' TCM_COMPILER='$(TCM_COMPILER)' TCM_INSTALL_CMD='$(TCM_INSTALL_CMD)' TCM_HOME='$(TCM_COMPILE_DIR)' TCM_INSTALL_SHARE='$(TCM_INSTALL_SHARE)'

UNAME=$(shell uname -s | sed -e 's/_NT.*//g')

ifeq ($(UNAME),IRIX64)
    UNAME = IRIX
endif

ifeq ($(UNAME),IRIX)
    TCM_PLATFORM = irix
    TCM_COMPILER = gcc
endif
ifeq ($(UNAME),Linux)
    TCM_PLATFORM = linux
    TCM_COMPILER = gcc
    TCM_INSTALL_CMD = /bin/cp -af
endif
ifeq ($(UNAME),HP-UX)
    TCM_PLATFORM = hpux
    TCM_COMPILER = gcc
endif
ifeq ($(UNAME),AIX)
    TCM_PLATFORM = aix
    TCM_COMPILER = gcc
    # TCM_COMPILER = xlc
endif
ifeq ($(UNAME),OSF1)
    TCM_PLATFORM = osf1
    TCM_COMPILER = gcc
endif
ifeq ($(UNAME),FreeBSD)
    TCM_PLATFORM = freebsd
    TCM_COMPILER = gcc
    TCM_INSTALL_CMD = /bin/cp -Rp
endif
ifeq ($(UNAME),SunOS)
    TCM_PLATFORM = solaris
    TCM_COMPILER = suncc
    TCM_INSTALL_CMD = /usr/bin/cp -fpr
    # TCM_PLATFORM = solaris.gcc
    # TCM_COMPILER = gcc
endif
ifeq ($(UNAME),CYGWIN)
    TCM_PLATFORM = CYGWIN
    TCM_COMPILER = gcc
    TCM_INSTALL_CMD = /bin/cp -dRf
endif

TCM_COMPILE_DIR=$(shell pwd)
TCM_HOME=$(TCM_COMPILE_DIR)
SUBDIRS = bin lib src doc

config:
	@echo making $@ for $(TCM_PLATFORM)...
	(cd ./src; rm -f ./Config.tmpl)
	(cd ./src; ln -s Config.tmpl_$(TCM_PLATFORM) Config.tmpl) 
	(cd ./src; rm -f ./Makefile)
	(cd ./src; ln -s Makefile.$(TCM_COMPILER) Makefile) 
	(cd ./src; touch ./gl/instances.h) 
	(cd ./lib/help; ln -s ../../CHANGELOG .) 
	(cd ./lib/help; ln -s ../../COPYING .) 
	@echo done making $@ for $(TCM_PLATFORM)
	@echo PLEASE CHECK FIRST THE SETTINGS IN src/Config.tmpl!
	@echo after that you can do the following: 
	@echo make depend: for making file dependencies
	@echo make execs: for making the binaries
	@echo make install: for copying the binaries and the files\
	       that they need to $(TCM_INSTALL_DIR)
	@echo \(this installation directory can be changed in $(TCM_HOME)/Makefile\)
	@echo make all: to do all this in one run
	@echo make clean: to remove all binaries, object and temporary files.

all: config depend execs install

execs:
	(cd ./src; ${MAKE} $(MFLAGS) all)

docs:
	(cd ./doc; ${MAKE} TCM_VERSION='$(TCM_VERSION)' all)

depend:
	(cd ./src; ${MAKE} TCM_HOME='$(TCM_COMPILE_DIR)' depend)

undepend:
	(cd ./src; ${MAKE} TCM_HOME='$(TCM_COMPILE_DIR)' undepend)

clean:
	@echo making $@...
	for dir in $(SUBDIRS); do \
                (cd $${dir}; ${MAKE} TCM_HOME='$(TCM_COMPILE_DIR)' $@); done
	@echo done making $@...

install:
	@echo making $@...
	if test ! -d $(TCM_INSTALL_DIR); then\
                mkdir -p $(TCM_INSTALL_DIR);\
                $(CHMOD) 755 $(TCM_INSTALL_DIR); fi
	$(TCM_INSTALL_CMD) README CHANGELOG COPYING FILEMAP \
			INSTALL_ README.cygwin INSTALL.cygwin man $(TCM_INSTALL_DIR)
	if test ! -d $(TCM_INSTALL_MAN); then\
		mkdir -p $(TCM_INSTALL_MAN);\
		$(CHMOD) 755 $(TCM_INSTALL_MAN); fi
	$(TCM_INSTALL_CMD) man/* $(TCM_INSTALL_MAN)
	for dir in $(SUBDIRS); do \
		(cd $${dir}; ${MAKE} $(MFLAGS) $@); done
	@echo done making $@...

-include $(TCM_HOME)/src/Config.tmpl