File: Makefile

package info (click to toggle)
ucbmpeg 1r2-6
  • links: PTS
  • area: non-free
  • in suites: hamm, potato, slink
  • size: 9,504 kB
  • ctags: 7,643
  • sloc: ansic: 79,920; tcl: 2,985; perl: 313; asm: 284; makefile: 269; csh: 13
file content (265 lines) | stat: -rw-r--r-- 8,610 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# 
# Copyright (c) 1995 The Regents of the University of California.
# All rights reserved.
# 
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement is
# hereby granted, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
# 
# IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
# OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
# CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 
# THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
# ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
# PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
# 

#  
#  $Header: /n/video/199/eyhung/encode/RCS/Makefile,v 1.7 1995/02/02 02:25:51 eyhung Exp $
# 

##############################################################################
#
# Configurable items
#

################################################################
# PROFILING # use -pg or -p if and only if you want to profile #
################################################################
PROFLAG =

##############
# JPEG STUFF #
##############
JPEG_LIB = jpeg/libjpeg.a
JPEG_DIR = -Ijpeg
JPEG_LIB_DIR = -Ljpeg
MP_JPEG_OBJS = jpeg.o
MP_JPEG_SRCS = jpeg.c

####################################################################
# DEBUGGING # use -g if and only if you want to debug, else use -O #
####################################################################
#DEBUGFLAG = -g 
DEBUGFLAG = -O

###############################################################################
# MISSING PROTOTYES # use -DMISSING_PROTOS if your standard headers are wrong #
###############################################################################
PROTOFLAG = 
#PROTOFLAG = -DMISSING_PROTOS

#################
# INCLUDE FILES # 
#################
INCLUDEDIR = -Iheaders -I/usr/include $(JPEG_DIR)

############################################################################
# LIBRARIES # specify library directories; need jpg lib and maybe pbm	   #
############################################################################
#LIBDIRS = -L$(PBMLIBDIR) $(JPEG_LIB_DIR)
LIBDIRS = $(JPEG_LIB_DIR)

#####################################################################
# COMPILER # specify compiler; should be ANSI-compliant if possible #
#####################################################################
CC = gcc

################################################
# MAKE # command to use for the "make" command #
################################################
MAKE = make

###################################################
# COMPILER FLAGS # modify for different compilers #
###################################################
# use -DLONG_32 iff
#	1) long's are 32 bits and
#	2) int's are not
#
# if you don't have <netinet/in.h> then you must define one of the following
#     -DFORCE_BIG_ENDIAN
#     -DFORCE_LITTLE_ENDIAN
#
# if you are using a non-ANSI compiler, then use:
#	-DNON_ANSI_COMPILER
#
# one other option:
#	-DHEINOUS_DEBUG_MODE
#
# listed below are some suggested CFLAG lines for various compilers
# 

#	gcc
CFLAGS	      =  $(INCLUDEDIR) $(DEBUGFLAG) -Wall -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG)

#	gcc-strict
#CFLAGS	      =  $(INCLUDEDIR) $(DEBUGFLAG) -pedantic -Wall -Waggregate-return -Wtraditional -Wshadow -Wpointer-arith -Wno-parentheses -Wwrite-strings -Wconversion -Wcast-qual -Wcast-align -Wnested-externs -Wuninitialized -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG)

#	SUN cc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DNON_ANSI_COMPILER

#	HP cc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DNON_ANSI_COMPILER

#	HP gcc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG)

#	DEC ALPHA cc
#CFLAGS = $(INCLUDEDIR) -Olimit 1200 $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG)

#	DEC Ultrix gcc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) -Wall -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG) -DMIPS

# 	SGI cc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -cckr -DIRIX

#	Intel-based SVR4.0 cc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DLONG_32 -DSVR4 -DSYSV386

#	Intel-based SCO Unix
#CFLAGS =  $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -Dsco -m486

# linux CFLAGS
#CFLAGS  = $(INCLUDEDIR) -m486 -fomit-frame-pointer -ffast-math -finline-functions $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG) -DLONG_32 -DSYSV -DLINUX

#	IBM RS/6000 cc
#CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) $(PROFLAG) $(PROTOFLAG)

# DOS
#CFLAGS        =  $(INCLUDEDIR) $(DEBUGFLAG) -O1 -DSYSV -DFORCE_LITTLE_ENDIAN -w-rvl -w-rch -w-eff -w-ccc -w-par -w-use -w-aus -w-pro $(PROFLAG) $(PROTOFLAG)


#########################################################################
# LIBRARIES # same for most machines; may need to add stuff for sockets #
#########################################################################
#	this works for most machines
LIBS = $(JPEG_LIB) -lm

#	Solaris
#LIBS = $(JPEG_LIB) -lm -lsocket -lnsl

#	Intel-based SVR4.0
#LIBS = $(JPEG_LIB) -lm -lsocket -lnsl -lgen

#	Intel-based SCO Unix
#LIBS = $(JPEG_LIB) -lX11 -lsocket -lmalloc -lPW -lc_s -lm 


###############
# OTHER STUFF #
###############
#PURIFY = purify -cache-dir=/tmp
PURIFY =

#
# End of configurable options.  Just type make and have fun.
##############################################################################

MP_BASE_OBJS = mfwddct.o postdct.o huff.o bitio.o mheaders.o
MP_BASE_SRCS = mfwddct.c postdct.c huff.c bitio.c mheaders.c
MP_ENCODE_OBJS = iframe.o pframe.o bframe.o psearch.o bsearch.o block.o 
MP_ENCODE_SRCS = iframe.c pframe.c bframe.c psearch.c bsearch.c block.c 
MP_OTHER_OBJS = mpeg.o subsample.o param.o rgbtoycc.o \
	readframe.o combine.o jrevdct.o frame.o fsize.o frametype.o \
	libpnmrw.o specifics.o rate.o opts.o
MP_OTHER_SRCS = mpeg.c subsample.c param.c rgbtoycc.c \
	readframe.c combine.c jrevdct.c frame.c fsize.c frametype.c \
	libpnmrw.c specifics.c rate.c opts.c
MP_PARALLEL_OBJS = parallel.o
MP_PARALLEL_SRCS = parallel.c
MP_ALL_SRCS = $(MP_BASE_SRCS) $(MP_OTHER_SRCS) $(MP_ENCODE_SRCS) \
	      $(MP_PARALLEL_SRCS) $(MP_JPEG_SRCS) main.c
MP_ALL_OBJS = $(MP_BASE_OBJS) $(MP_OTHER_OBJS) $(MP_ENCODE_OBJS) \
	      $(MP_PARALLEL_OBJS) $(MP_JPEG_OBJS) main.o
MP_INCLUDE = mproto.h mtypes.h huff.h bitio.h
MP_MISC = Makefile huff.table parse_huff.pl

all: mpeg_encode

#########
# TESTS #
#########

test:
	rm -f /tmp/ts.stat
	./mpeg_encode -stat /tmp/ts.stat ./tst/ts.param
	csh ./tst/diffscript /tmp/ts.stat ./tst/ts.stat /tmp/ts.mpg ./tst/ts.mpg

testd:
	rm -f /tmp/tsd.stat
	./mpeg_encode -stat /tmp/tsd.stat ./tst/tsd.param
	csh ./tst/diffscript /tmp/tsd.stat ./tst/tsd.stat /tmp/tsd.mpg ./tst/tsd.mpg

test_all: test testd

############
# BINARIES #
############

mpeg_encode: $(MP_ALL_OBJS) $(JPEG_LIB)
	$(PURIFY) $(CC) $(CFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)
	strip mpeg_encode

profile: $(MP_ALL_OBJS)
	$(PURIFY) $(CC) -Bstatic -pg $(CFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)

#########
# OTHER #
#########

# make JPEG compile itself
jpeg/libjpeg.a:
	(cd jpeg; $(MAKE) libjpeg.a)

#
# Perl is necessary if you want to modify the Huffman RLE encoding table.
#
PERL = perl

# The following stuff is for the Huffman encoding tables.  It's commented-out
# because you probably don't want to change this.  If you do, then uncommment
# it.
#
# huff.h: huff.c
#
# huff.c: parse_huff.pl huff.table
#	$(PERL) parse_huff.pl huff.table

headers.o: headers.c
	$(CC) $(CFLAGS) -c headers.c

depend: huff.c
	makedepend -- $(CFLAGS) -- $(MP_ALL_SRCS)

wc:;		wc -l *.[ch] headers/*.h *.pl *.table
ci:;		ci -l $(MP_ALL_SRCS) $(MP_INCLUDE) $(MP_MISC)
tags: $(MP_ALL_SRCS)
	ctags -t $(MP_ALL_SRCS)
	etags -f TAGS -t $(MP_ALL_SRCS) headers/*.h

new:
	rm -f *.o core *~ gmon.out
	$(MAKE) depend

clean:
	-rm -f *.o core *~ gmon.out
	$(MAKE) depend
	-$(MAKE) tags

#
# WARNING: this assumes you're using GNU indent...
#
indent:;	indent -T FILE -T int8 -T int16 -T int32 -T uint8 -T uint16 -T uint32  -T BitBucket -T MpegFrame -T Block -T FlatBlock $(MP_ALL_SRCS)

spotless: clean	
	rm -f huff.c huff.h *.pure.a
	cd jpeg; $(MAKE) clean

##############################################################################
# DO NOT DELETE THIS LINE -- make depend depends on it.