Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 1999 09:28:29 +0100
From:      "HEITMEIER,MICHAEL (HP-Germany,ex1)" <michael_heitmeier@bbn.exch.hp.com>
To:        "'questions@freebsd.org'" <questions@freebsd.org>
Subject:   Trouble compiling: make
Message-ID:  <234F92BA3C7BD311BD31009027541A953A5509@wagner.bbn.hp.com>

next in thread | raw e-mail | index | archive | help
Trying to compile lame3.5 is bringing up some interesting twists. The
Makefile seems to be in a format that is not recognised by FreeBSD.
Examples:
ifeq ($(UNAME), XX) does not work, FreeBSD wants
.if $(UNAME) == XX'

-include $(DEP), FreeBSD wants
.include <$(DEP)>

This has elicited the reaction "that FreeBSD is somehow different from all
the rest... bizzare"
Is that true? Is there no reliable standard of how Makefile syntax works?

My real question is of course what do I need to do to get the make work with
FreeBSD? The attached Makefile always fails, complaining is does not find
the .d files, so is the include not working, or why would the dependencies
not be available?

I have made the modifications shown above but now I'm at the end of my wits.


Thanks for any help,

Michael




# Makefile for LAME 3.xx
#
# LAME is reported to work under:  
# Linux (i86), NetBSD 1.3.2 (StrongARM), FreeBSD (i86)
# Compaq Alpha(OSF, Linux, Tru64 Unix), Sun Solaris, SGI IRIX,
# OS2 Warp, Macintosh PPC, BeOS, Amiga and even VC++ 
# 
UNAME = $(shell uname)
ARCH = $(shell uname -m)


# defaults:
PGM = lame
CC = gcc
CC_OPTS = -O   	
GTK = 
GTKLIBS = 
SNDLIB = 
LIBSNDFILE =
LIBS = -lm 
MAKEDEP = -M
BRHIST_SWITCH = 
LIBTERMCAP = 

##########################################################################
# FreeBSD
##########################################################################
.if $(UNAME) == FreeBSD
#  remove if you do not have GTK or do not want the GTK frame analyzer
   GTK = -DHAVEGTK `gtk12-config --cflags`
   GTKLIBS = `gtk12-config --libs` 
# Comment out next 2 lines if you want to remove VBR histogram capability
   BRHIST_SWITCH = -DBRHIST
   LIBTERMCAP = -lncurses
.endif


CC_SWITCHES = -DNDEBUG -D__NO_MATH_INLINES $(CC_OPTS) $(SNDLIB) $(GTK)
$(BRHIST_SWITCH)
c_sources = \
	formatBitstream.c \
	fastmdct.c \
	filterbank.c \
	fft.c \
	get_audio.c \
	l3bitstream.c \
        id3tag.c \
	ieeefloat.c \
        lame.c \
	psymodel.c \
	portableio.c \
	quantize.c \
	reservoir.c \
	tables.c \
	takehiro.c \
	timestatus.c \
	util.c \
        VbrTag.c \
        version.c \
        gtkanal.c \
        gpkplotting.c \
        mpglib/common.c \
        mpglib/dct64_i386.c \
        mpglib/decode_i386.c \
        mpglib/layer3.c \
        mpglib/tabinit.c \
        mpglib/interface.c \
        mpglib/main.c 

OBJ = $(c_sources:.c=.o)
DEP = $(c_sources:.c=.d)

%.o: %.c 
	$(CC) $(CC_SWITCHES) -c $< -o $@

%.d: %.c
	$(SHELL) -ec '$(CC) $(MAKEDEP)  $(CC_SWITCHES)  $< | sed
'\''s;$*.o;& $@;g'\'' > $@'

$(PGM):	main.o $(OBJ) Makefile 
	$(CC) -o $(PGM)  main.o $(OBJ) $(LIBS) $(LIBSNDFILE) $(GTKLIBS)
$(LIBTERMCAP)

#$(PGM):	main.o libmp3lame.a Makefile 
#	$(CC) -o $(PGM)  main.o -L. -lmp3lame $(LIBS) $(LIBSNDFILE)
$(GTKLIBS) $(LIBTERMCAP)

mp3x:	mp3x.o $(OBJ) Makefile 
	$(CC) -o mp3x mp3x.o  $(OBJ) $(LIBS) $(LIBSNDFILE) $(GTKLIBS)
$(LIBTERMCAP)

libmp3lame.a:  $(OBJ) Makefile
	ar cr libmp3lame.a  $(OBJ) 

clean:
	-rm $(OBJ) $(DEP) $(PGM) main.o mp3x.o mp3x libmp3lame.a \
                      mp3resample.o mp3resample	

tags: TAGS

TAGS: ${c_sources}
	etags -T ${c_sources}

.include <$(DEP)>

test15: $(PGM)
	./lame  ../test/castanets.wav
	cmp -l ../test/castanets.wav.mp3 ../test/castanets.ref15.mp3 | head
test15h: $(PGM)
	./lame  -h  ../test/castanets.wav
	cmp -l ../test/castanets.wav.mp3 ../test/castanets.ref15h.mp3 | head
test14: $(PGM)
	./lame  ../test/castanets.wav
	cmp -l ../test/castanets.wav.mp3 ../test/castanets.ref14.mp3 | head
test14h: $(PGM)
	./lame  -h  ../test/castanets.wav
	cmp -l ../test/castanets.wav.mp3 ../test/castanets.ref14h.mp3 | head
testg: $(PGM)
	./lame -h -g ../test/castanets.wav


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?234F92BA3C7BD311BD31009027541A953A5509>