From cd0e322d2ddb9d43c7e1a6ec617267f733d20c54 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Wed, 23 Oct 2002 22:08:13 +0000 Subject: [PATCH] add notion of topdir to Makefile.lite build system --- Makefile.lite | 8 ++++++-- build/config.mk | 2 +- build/exe.mk | 6 +++--- build/lib.mk | 4 ++-- doc/Makefile.lite | 2 ++ src/flac/Makefile.lite | 10 ++++++---- src/libFLAC++/Makefile.lite | 6 ++++-- src/libFLAC/Makefile.lite | 6 ++++-- src/libOggFLAC++/Makefile.lite | 6 ++++-- src/libOggFLAC/Makefile.lite | 6 ++++-- src/metaflac/Makefile.lite | 6 ++++-- src/plugin_common/Makefile.lite | 6 ++++-- src/plugin_xmms/Makefile.lite | 8 +++++--- src/share/Makefile.lite | 6 ++++-- src/test_libFLAC++/Makefile.lite | 6 ++++-- src/test_libFLAC/Makefile.lite | 6 ++++-- src/test_libOggFLAC++/Makefile.lite | 6 ++++-- src/test_libOggFLAC/Makefile.lite | 6 ++++-- src/test_streams/Makefile.lite | 6 ++++-- test/Makefile.lite | 3 +++ 20 files changed, 76 insertions(+), 39 deletions(-) diff --git a/Makefile.lite b/Makefile.lite index 86861de0..9297f50a 100644 --- a/Makefile.lite +++ b/Makefile.lite @@ -27,6 +27,8 @@ # clean : remove all non-distro files # +topdir = . + .PHONY: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_common plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams all: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_common plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams @@ -56,7 +58,8 @@ libOggFLAC++: libFLAC (cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG)) share: - (cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG)) + (cd src/$@/getopt ; $(MAKE) -f Makefile.lite $(CONFIG)) + (cd src/$@/utf8 ; $(MAKE) -f Makefile.lite $(CONFIG)) flac: libFLAC libOggFLAC share (cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG)) @@ -94,7 +97,8 @@ clean: -(cd src/libFLAC++ ; $(MAKE) -f Makefile.lite clean) -(cd src/libOggFLAC ; $(MAKE) -f Makefile.lite clean) -(cd src/libOggFLAC++ ; $(MAKE) -f Makefile.lite clean) - -(cd src/share ; $(MAKE) -f Makefile.lite clean) + -(cd src/share/getopt ; $(MAKE) -f Makefile.lite clean) + -(cd src/share/utf8 ; $(MAKE) -f Makefile.lite clean) -(cd src/flac ; $(MAKE) -f Makefile.lite clean) -(cd src/metaflac ; $(MAKE) -f Makefile.lite clean) -(cd src/plugin_common ; $(MAKE) -f Makefile.lite clean) diff --git a/build/config.mk b/build/config.mk index 460dc1d0..5c84ba39 100644 --- a/build/config.mk +++ b/build/config.mk @@ -21,7 +21,7 @@ VERSION=\"1.0.4\" -ORDINALS_H = ../../include/FLAC/ordinals.h +ORDINALS_H = $(topdir)/include/FLAC/ordinals.h $(ORDINALS_H): $(ORDINALS_H).in sed \ diff --git a/build/exe.mk b/build/exe.mk index da514803..1b08a4c1 100644 --- a/build/exe.mk +++ b/build/exe.mk @@ -34,13 +34,13 @@ else LINKAGE = -static endif LINK = $(CC) $(LINKAGE) -BINPATH = ../../obj/bin -LIBPATH = ../../obj/lib +BINPATH = $(topdir)/obj/bin +LIBPATH = $(topdir)/obj/lib PROGRAM = $(BINPATH)/$(PROGRAM_NAME) all : release -include ../../build/config.mk +include $(topdir)/build/config.mk debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) diff --git a/build/lib.mk b/build/lib.mk index 62604138..9f12a466 100644 --- a/build/lib.mk +++ b/build/lib.mk @@ -28,7 +28,7 @@ CCC = g++ endif NASM = nasm LINK = ar cru -LIBPATH = ../../obj/lib +LIBPATH = $(topdir)/obj/lib ifeq ($(DARWIN_BUILD),yes) STATIC_LIB_SUFFIX = a DYNAMIC_LIB_SUFFIX = dylib @@ -46,7 +46,7 @@ endif all : release -include ../../build/config.mk +include $(topdir)/build/config.mk debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) diff --git a/doc/Makefile.lite b/doc/Makefile.lite index f62c8f9b..867682c6 100644 --- a/doc/Makefile.lite +++ b/doc/Makefile.lite @@ -15,6 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +topdir = .. + FLAC.tag: Doxyfile rm -rf doxytmp doxygen Doxyfile diff --git a/src/flac/Makefile.lite b/src/flac/Makefile.lite index fc3088f4..c36cb2f8 100644 --- a/src/flac/Makefile.lite +++ b/src/flac/Makefile.lite @@ -19,18 +19,20 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = flac ifeq ($(DARWIN_BUILD),yes) -INCLUDES = -I./include -I../../include +INCLUDES = -I./include -I$(topdir)/include LIBS = -lFLAC -lgetopt -lutf8 -lc -lm else #@@@ TODO: conditionalize ogg includes, defines, and -logg ifeq ($(SOLARIS_BUILD),yes) -INCLUDES = -I./include -I../../include -I$(HOME)/local/include -DFLAC__HAS_OGG +INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG LIBS = -lOggFLAC -lFLAC -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg else #@@@ TODO: conditionalize ogg includes, defines, and -logg -INCLUDES = -I./include -I../../include -I$(HOME)/local/include -DFLAC__HAS_OGG +INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG LIBS = -lOggFLAC -lFLAC -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg endif endif @@ -43,6 +45,6 @@ OBJS = \ main.o \ vorbiscomment.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/libFLAC++/Makefile.lite b/src/libFLAC++/Makefile.lite index a294f4c7..b4f4666e 100644 --- a/src/libFLAC++/Makefile.lite +++ b/src/libFLAC++/Makefile.lite @@ -20,8 +20,10 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libFLAC++ -INCLUDES = -I../../include +INCLUDES = -I$(topdir)/include OBJS = \ file_decoder.o \ @@ -32,6 +34,6 @@ OBJS = \ stream_decoder.o \ stream_encoder.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/libFLAC/Makefile.lite b/src/libFLAC/Makefile.lite index 2a81e3d8..f14c36fb 100644 --- a/src/libFLAC/Makefile.lite +++ b/src/libFLAC/Makefile.lite @@ -20,6 +20,8 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libFLAC ifeq ($(DARWIN_BUILD),yes) DEFINES = -DFLAC__NO_NASM -DFLAC__ALIGN_MALLOC_DATA @@ -30,7 +32,7 @@ else DEFINES = -DFLAC__CPU_IA32 -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA endif endif -INCLUDES = -I./include -I../../include +INCLUDES = -I./include -I$(topdir)/include DEBUG_CFLAGS = -DFLAC__OVERFLOW_DETECT ifeq ($(DARWIN_BUILD),yes) @@ -64,6 +66,6 @@ OBJS = $(ASM_OBJS) \ stream_encoder.o \ stream_encoder_framing.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/libOggFLAC++/Makefile.lite b/src/libOggFLAC++/Makefile.lite index 025d6e2e..7b1c6dab 100644 --- a/src/libOggFLAC++/Makefile.lite +++ b/src/libOggFLAC++/Makefile.lite @@ -20,13 +20,15 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libOggFLAC++ -INCLUDES = -I../../include +INCLUDES = -I$(topdir)/include OBJS = \ stream_decoder.o \ stream_encoder.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/libOggFLAC/Makefile.lite b/src/libOggFLAC/Makefile.lite index 5034f0cb..2c2a0c10 100644 --- a/src/libOggFLAC/Makefile.lite +++ b/src/libOggFLAC/Makefile.lite @@ -20,6 +20,8 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libOggFLAC ifeq ($(DARWIN_BUILD),yes) DEFINES = @@ -30,13 +32,13 @@ else DEFINES = endif endif -INCLUDES = -I./include -I../../include -I$(HOME)/local/include +INCLUDES = -I./include -I$(topdir)/include -I$(HOME)/local/include DEBUG_CFLAGS = OBJS = \ stream_decoder.o \ stream_encoder.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/metaflac/Makefile.lite b/src/metaflac/Makefile.lite index e7d4b663..f6e5393e 100644 --- a/src/metaflac/Makefile.lite +++ b/src/metaflac/Makefile.lite @@ -19,13 +19,15 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = metaflac -INCLUDES = -I./include -I../../include +INCLUDES = -I./include -I$(topdir)/include LIBS = -lFLAC -lgetopt -lutf8 -lm OBJS = \ main.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/plugin_common/Makefile.lite b/src/plugin_common/Makefile.lite index 0136bffb..4e594173 100644 --- a/src/plugin_common/Makefile.lite +++ b/src/plugin_common/Makefile.lite @@ -2,8 +2,10 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libplugin_common -INCLUDES = -I../../include -I$(HOME)/local/include +INCLUDES = -I$(topdir)/include -I$(HOME)/local/include DEFINES = -DFLAC__HAS_ID3LIB -DID3LIB_MAJOR=3 -DID3LIB_MINOR=8 -DID3LIB_PATCH=0 OBJS = \ @@ -14,6 +16,6 @@ OBJS = \ id3v2.o \ vorbiscomment.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/plugin_xmms/Makefile.lite b/src/plugin_xmms/Makefile.lite index 01f317bd..617d3286 100644 --- a/src/plugin_xmms/Makefile.lite +++ b/src/plugin_xmms/Makefile.lite @@ -19,9 +19,11 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libxmms-flac -INCLUDES = $(shell xmms-config --cflags) -I./include -I../../include -I.. -LIBS = ../../obj/lib/libFLAC.a ../../obj/lib/libplugin_common.a +INCLUDES = $(shell xmms-config --cflags) -I./include -I$(topdir)/include -I.. +LIBS = $(topdir)/obj/lib/libFLAC.a $(topdir)/obj/lib/libplugin_common.a OBJS = \ charset.o \ @@ -29,6 +31,6 @@ OBJS = \ plugin.o \ wrap_id3.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/share/Makefile.lite b/src/share/Makefile.lite index c06beda1..3ac74d05 100644 --- a/src/share/Makefile.lite +++ b/src/share/Makefile.lite @@ -2,14 +2,16 @@ # GNU makefile # +topdir = ../.. + LIB_NAME = libgetopt -INCLUDES = -I../../include -I../../include/share +INCLUDES = -I$(topdir)/include -I$(topdir)/include/share OBJS = \ getopt.o \ getopt1.o -include ../../build/lib.mk +include $(topdir)/build/lib.mk # Our lame Makefile.lite system has no provision for building multiple libs in # a directory, so we hack it: diff --git a/src/test_libFLAC++/Makefile.lite b/src/test_libFLAC++/Makefile.lite index d9850903..36ce25de 100644 --- a/src/test_libFLAC++/Makefile.lite +++ b/src/test_libFLAC++/Makefile.lite @@ -19,8 +19,10 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = test_libFLAC++ -INCLUDES = -I../../include +INCLUDES = -I$(topdir)/include LIBS = -lFLAC++ -lFLAC -lm OBJS = \ decoders.o \ @@ -31,7 +33,7 @@ OBJS = \ metadata_manip.o \ metadata_object.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk LINK = $(CCC) $(LINKAGE) diff --git a/src/test_libFLAC/Makefile.lite b/src/test_libFLAC/Makefile.lite index f348b150..b4c1f499 100644 --- a/src/test_libFLAC/Makefile.lite +++ b/src/test_libFLAC/Makefile.lite @@ -19,8 +19,10 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = test_libFLAC -INCLUDES = -I../libFLAC/include -I../../include +INCLUDES = -I../libFLAC/include -I$(topdir)/include LIBS = -lFLAC -lm OBJS = \ bitbuffer.o \ @@ -33,6 +35,6 @@ OBJS = \ metadata_object.o \ metadata_utils.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/test_libOggFLAC++/Makefile.lite b/src/test_libOggFLAC++/Makefile.lite index ab8db480..8707bf84 100644 --- a/src/test_libOggFLAC++/Makefile.lite +++ b/src/test_libOggFLAC++/Makefile.lite @@ -19,9 +19,11 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = test_libOggFLAC++ #@@@ TODO: conditionalize ogg lib path and -logg -INCLUDES = -I../../include +INCLUDES = -I$(topdir)/include LIBS = -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm OBJS = \ decoders.o \ @@ -29,7 +31,7 @@ OBJS = \ file_utils.o \ main.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk LINK = $(CCC) $(LINKAGE) diff --git a/src/test_libOggFLAC/Makefile.lite b/src/test_libOggFLAC/Makefile.lite index f171d649..2a937894 100644 --- a/src/test_libOggFLAC/Makefile.lite +++ b/src/test_libOggFLAC/Makefile.lite @@ -19,9 +19,11 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = test_libOggFLAC #@@@ TODO: conditionalize ogg lib path and -logg -INCLUDES = -I../../include +INCLUDES = -I$(topdir)/include LIBS = -lOggFLAC -lFLAC -lm -L$(HOME)/local/lib -logg OBJS = \ decoders.o \ @@ -30,6 +32,6 @@ OBJS = \ main.o \ metadata_utils.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/src/test_streams/Makefile.lite b/src/test_streams/Makefile.lite index c843a3e4..1b480610 100644 --- a/src/test_streams/Makefile.lite +++ b/src/test_streams/Makefile.lite @@ -19,12 +19,14 @@ # GNU makefile # +topdir = ../.. + PROGRAM_NAME = test_streams -INCLUDES = -I./include -I../../include +INCLUDES = -I./include -I$(topdir)/include LIBS = -lm OBJS = \ main.o -include ../../build/exe.mk +include $(topdir)/build/exe.mk # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/test/Makefile.lite b/test/Makefile.lite index 0e53fa19..58ebc62f 100644 --- a/test/Makefile.lite +++ b/test/Makefile.lite @@ -18,6 +18,9 @@ # # GNU makefile # + +topdir = .. + all: clean FLAC__EXHAUSTIVE_TESTS=yes ./test_libFLAC.sh FLAC__EXHAUSTIVE_TESTS=yes ./test_libFLAC++.sh