File: Makefile

package info (click to toggle)
ultra 2.99a-devel4-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,108 kB
  • ctags: 5,443
  • sloc: ansic: 44,373; yacc: 2,036; makefile: 835; sh: 653; lex: 548
file content (212 lines) | stat: -rw-r--r-- 5,471 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# ****************************************************************************
#                Makefile for The Linux Ultra Sound Project
#         Copyright (c) 1994-1997 by Jaroslav Kysela (Perex soft)
# ****************************************************************************

.EXPORT_ALL_VARIABLES:

CALL_FROM_GLOBAL_MAKEFILE = 1
include Makefile.conf
CALL_FROM_GLOBAL_MAKEFILE =

ifdef ARCH_i386
ARCH_NAME	= i386
ARCH_COPTS	= -m386
endif

ifdef ARCH_i486
ARCH_NAME	= i486
ARCH_COPTS	= -m486
endif

ifdef ARCH_pentium
ARCH_NAME	= pentium
ARCH_COPTS	= -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
endif

ifdef ARCH_ppro
ARCH_NAME	= ppro
ARCH_COPTS	= -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
endif

ifdef ARCH_alpha
ARCH_NAME	= alpha
ARCH_COPTS	=
endif

ifndef ARCH_NAME
ARCH_NAME	= unknown
ARCH_COPTS	=
endif

ARCH_SUPPORTED	= "i386 i486 pentium ppro alpha"
ARCH_MP_SUPPORTED = "none smp"

ifdef ARCH_MP_SMP
ifndef ARCH_NUMCPU
ARCH_NUMCPU	= 2
endif
ARCH_MP_NAME	= "smp"
else
ARCH_NUMCPU	= 0
ARCH_MP_NAME	= "none"
endif

MAKE_JOBS	= `expr $(ARCH_NUMCPU) + 1`

# options for C compiler
ARCH_COPTS	+= -O2
# options for make
ARCH_MOPTS	=

# ****************************************************************************

U_SUBDIRS	= src include lib bin sbin etc examples doc
U_LIST		= `pwd`/.files
U_REVISION	= `cat .revision`

MAKE1		= make $(ARCH_MOPTS)
MAKE		= $(MAKE1) -j $(MAKE_JOBS)

all: welcome0
	@echo " make compile    - compile all targets"
	@echo " make install    - compile & install all targets"
	@echo " make uninstall  - uninstall all targets"
	@echo
	@setterm -reverse on
	@echo "Trouble? Consult FAQ file or send e-mail to <ultra@pf.jcu.cz>."
	@setterm -reverse off
	@echo
	@echo "Please, don't waste my time by answering to some simple questions."
	@echo
	@echo "                                  thank you very much - Jaroslav Kysela"
	@echo

welcome0:
	@echo
	@echo "Welcome to the Linux Ultra Sound Project"
	@echo "========================================"
	@echo

welcome1: welcome0
	@echo "Supported system architectures    : $(ARCH_SUPPORTED)"
	@echo "Target system architecture        : $(ARCH_NAME)"
	@echo "Supported multiprocessor arch...s : $(ARCH_MP_SUPPORTED)"
	@echo "Multiprocessor architecture       : $(ARCH_MP_NAME)"
	@echo "Make - jobs to run simultaneously : $(MAKE_JOBS)"
	@echo "Targed directory for executables  : '$(U_BIN_DIR)'"
	@echo "Targed directory for daemons      : '$(U_DMN_DIR)'"
	@echo "Targed directory for modules/cfg  : '$(U_MOD_DIR)'"
	@echo "Targed directory for C libraries  : '$(U_LIB_DIR)'"
	@echo "Targed directory for C headers    : '$(U_HDR_DIR)'"
	@echo "Targed directory for instr..s cfg : '$(U_INS_DIR)'"
	@echo

compile: welcome1
	@echo -n "Hit 'Enter' to compile all targets or 'Ctrl-C' to abort... "
	@read
	@echo

	@$(MAKE) -s -C src tgtcheck
	@echo
	@echo -n "Hit 'Enter' to continue or 'Ctrl-C' to abort... "
	@read

	@for i in $(U_SUBDIRS); do \
	  if ! $(MAKE) -C $$i \
		FINAL_VERSION=1 \
		LIST_OF_FILES=$(U_LIST) \
		INSTALL_DIRECTORY=$(U_BIN_DIR) \
		MODULES_DIRECTORY=$(U_MOD_DIR) \
		DAEMONS_DIRECTORY=$(U_DMN_DIR) \
		LIBRARIES_DIRECTORY=$(U_LIB_DIR) \
		HEADERS_DIRECTORY=$(U_HDR_DIR) gcompile; then exit 1; fi; \
	 done

	@echo
	@echo "All targets for the Linux Ultra Sound Project was successfully compiled..."
	@echo

install: welcome1
	@echo -n "Hit 'Enter' to compile and install all targets or 'Ctrl-C' to abort... "
	@read
	@echo

	@$(MAKE) -s -C src tgtcheck
	@echo
	@echo -n "Hit 'Enter' to continue or 'Ctrl-C' to abort... "
	@read

	@rm -f .files
	@for i in $(U_BIN_DIR) $(U_DMN_DIR) $(U_MOD_DIR) $(U_LIB_DIR) $(U_HDR_DIR); do \
          if [ -d $$i ]; then \
            echo > /dev/null; \
          else \
            install -d -o root -g root $$i; \
          fi; \
         done
	@for i in $(U_SUBDIRS); do \
	  if ! $(MAKE) -C $$i \
		FINAL_VERSION=1 \
		LIST_OF_FILES=$(U_LIST) \
		INSTALL_DIRECTORY=$(U_BIN_DIR) \
		MODULES_DIRECTORY=$(U_MOD_DIR) \
		DAEMONS_DIRECTORY=$(U_DMN_DIR) \
		LIBRARIES_DIRECTORY=$(U_LIB_DIR) \
		HEADERS_DIRECTORY=$(U_HDR_DIR) \
		ginstall; then exit 1; fi; \
	 done

#	@echo "----"
#	@sh src/utils/lsfiles $(U_LIST)
#	@echo "----"
	@echo
	@echo "All targets for the Linux Ultra Sound Project are successfully installed..."
	@echo

uninstall:
	@sh src/utils/uninstall $(U_LIST)

clean:
	rm -rf ultra-* usr
	for i in $(U_SUBDIRS); do $(MAKE) -C $$i clean; done
	rm -f *~ .*~ .lgdb doc/*~

pack:	clean pack0 lsm
	@echo -----
	@ls -l ../ultra-${U_REVISION}.lsm
	@ls -l ../ultra-${U_REVISION}.tgz

diff:	clean clean0
	-diff -ruN ../ultra-${DIFF} ../ultra > ../ultra-${U_REVISION}.patch

floppy:	pack
	@echo "Insert EXT2 floppy disk to first drive..."
	@read
	@mount /mnt/floppy
	@rm -rf /mnt/floppy/ultra-* /mnt/floppy/backup
	@mkdir /mnt/floppy/backup
	@/bin/cp -v ../ultra-${U_REVISION}.* /mnt/floppy
	@/bin/cp -v ../ultra-${U_REVISION}.* /mnt/floppy/backup
	@umount /mnt/floppy

tape:	pack
	@echo "Insert TAPE to streamer..."
	@read
	@mt eod
	@tar cvf /dev/tape -C .. ultra-${U_REVISION}.lsm ultra-${U_REVISION}.tgz
	@mt rewind

clean0:
	rm -f `find . -name core`
	rm -f .config .config? .files src/driver/config.h
	chown -R root.root ../ultra

pack0: clean0
	@echo "Building package: ultra-${U_REVISION}.tgz"
	mv ../ultra ../ultra-${U_REVISION} 
	- tar -cvzC .. -f ../ultra-${U_REVISION}.tgz ultra-${U_REVISION}
	mv ../ultra-${U_REVISION} ../ultra

lsm:
	sh src/utils/ultra.lsm > ../ultra-${U_REVISION}.lsm