GNUmakefile 2.8 KB

#############################################################
#
#  Makefile : Nintendo 64 Music Tools Programmers Library
#  (c) Copyright 1997/1998, Software Creations (Holdings) Ltd.
#
#  Version 3.11
#
#  Make file for library.
#
#############################################################

# special option #
# If you are using older N64OS than OS2.0i with patch5, uncomment next line.
#USE_OLD_LIBRARY = -D_OLD_AUDIO_LIBRARY

include $(ROOT)/usr/include/make/PRdefs

# command names #
#AR		= ar cq
#RM		= rm -f
#CC		= cc
#LD		= ld
CP		= cp
VPATH		= .

.PATH:	..

# addition files used by make #
FILE_MAKEROM	= Makefile.makerom
FILE_DEPENDS	= $(VPATH)/Makefile.depend

# compilation and linking settings #
OPTIMIZER 	= -O2 -mips2

# standard compilation and linking settings #
#CCOPTS		= -Wab,-r4300_mul $(DEFINES) -fullwarn\
	 	  -non_shared -G 0 -Xcpluscomm -I/usr/include/PR  -I../
#LDFLAGS		= $(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib\
		  -L$(ROOT)/usr/lib/PR $(LIBS)
CCOPTS = -Wall -G 0 -I$(ROOT)/usr/include/PR -I../ -I$(ROOT)/usr/include $(DEFINES)
LDFLAGS = $(MKDEPOPT) -L$(ROOT)/usr/lib  -L$(ROOT)/usr/lib/PR $(LIBS)

HFILES = libmus.h libmus_data.h
# files to be made #
LIBFILES	= player.c player_fx.c aud_dma.c aud_samples.c aud_sched.c aud_thread.c lib_memory.c
LIBOBJECTS	= $(LIBFILES:.c=.o)
TARGETS =  libmus.a libn_mus.a libmus_d.a libn_mus_d.a

LDIRT = libmus libmus_d libn_mus libn_mus_d

# default builds all libraries...
default:	$(TARGETS)

include $(COMMONRULES)
include $(FILE_DEPENDS)

# generate music library file #
thislib:	$(LIBOBJECTS)
	$(AR) cru $(LIBNAME) $(LIBOBJECTS)
	$(CP) $(LIBNAME) ..

install: $(TARGETS)
	${INSTALL} -m 444 -F /usr/include $(HFILES)
	${INSTALL} -m 444 -F /usr/lib $(TARGETS)

# compile C files to object files #
.c.o:
	$(CC) $(CCOPTS) $(OPTIMIZER) $(USE_OLD_LIBRARY) -c ../$*.c


#############################################################
# build libraries
#############################################################

# standard library
libmus.a:
	@if [ ! -d libmus ]; then mkdir libmus; fi;
	cd  libmus ; make -f ../GNUmakefile thislib LIBNAME='libmus.a' DEFINES='' OPTIMIZER='-O2 -mips2' VPATH='..'; cd ..

# n_audio library
libn_mus.a:
	@if [ ! -d libn_mus ]; then mkdir libn_mus; fi;
	cd  libn_mus ; make -f ../GNUmakefile thislib LIBNAME='libn_mus.a' DEFINES='-DSUPPORT_NAUDIO' OPTIMIZER='-O2 -mips2' VPATH='..'; cd ..

# debug library
libmus_d.a:
	@if [ ! -d libmus_d ]; then mkdir libmus_d; fi;
	cd  libmus_d ; make -f ../GNUmakefile thislib LIBNAME='libmus_d.a' DEFINES='-D_AUDIODEBUG' OPTIMIZER='-g0 -mips2' VPATH='..'; cd ..

# debug n_audio library
libn_mus_d.a:
	@if [ ! -d libn_mus_d ]; then mkdir libn_mus_d; fi;
	cd  libn_mus_d ; make -f ../GNUmakefile thislib LIBNAME='libn_mus_d.a' DEFINES='-D_AUDIODEBUG -DSUPPORT_NAUDIO' OPTIMIZER='-g0 -mips2' VPATH='..'; cd ..


# end of file #