Makefile 2.52 KB
#!smake
#
# Makefile to build libleo.a
#

SUBDIR=api

COMMONPREF=$(SUBDIR)

PRDEPTH=$(ROOT)/PR
include $(PRDEPTH)/PRdefs

LIBDEPTH=..
include $(LIBDEPTH)/libdefs

sinclude locdefs

CFILES =

ASFILES =

#if !( $(LIBNAME) == "LEOIPL_D" || $(LIBNAME) == "LEOIPL" \
	|| $(LIBNAME) == "LEOIPL_ER" )
CFILES += \
	bytetolba.c		\
	createleomanager.c	\
	clearqueue.c		\
	driveexist.c		\
	inquiry.c		\
	lbatobyte.c		\
	leoglobals.c		\
	modeselectasync.c	\
	readcapacity.c		\
	readdiskid.c		\
	readrtc.c		\
	readwrite.c		\
	rezero.c		\
	seek.c			\
	setrtc.c		\
	spdlmotor.c		\
	testunitready.c		\
	leointerrupt.c		\
	leodiskinit.c		\
	driverominit.c

ASFILES += \
	getaadr.s		\
	getaadr2.s		\
	getkadr.s

#endif

#if $(LIBNAME) == "LEO_SP"
CFILES += \
	sysreadwrite.c		\
	readwritelong.c		\
	sectorread.c
#endif

OBJECTS = $(ASFILES:.s=.o) $(CFILES:.c=.o)

#if !( $(LIBNAME) == "LEOIPL_D" || $(LIBNAME) == "LEOIPL" \
        || $(LIBNAME) == "LEOIPL_ER" )
OBJECTS += \
	bootdisk.o		\
	bootstrap.o		\
	cjcreateleomanager.o	\
	cacreateleomanager.o
#endif

LCINCS  = -I. -I../org/include -I$(ROOT)/usr/include/PR -I$(ROOT)/PR/libultra/include
#LCOPTS = -non_shared -mips2 -fullwarn -G 0 -wlint,-f
LCOPTS = -non_shared -mips2 -fullwarn -G 0
#OPTIMIZER = -g          # defined in locdefs

LASOPTS   = -non_shared -G 0 -mips2
LASINCS   = -I. -I$(PRDEPTH)/include

#if $(LIBNAME) != "LEO_SP"
include $(LIBDEPTH)/librules
#elseif
libddwrite: $(LIBDEPTH)/libddwrite/libddwrite.a $(LIBDEPTH)/libddwrite/libleo_sp.a

$(LIBDEPTH)/libddwrite/libddwrite.a: $(.TARGET)($(OBJECTS))
	ar rc $(.TARGET) $(.OODATE)
	...
	rm -f $(.OODATE)

$(LIBDEPTH)/libddwrite/libleo_sp.a: $(.TARGET)($(OBJECTS))
	ar rc $(.TARGET) $(.OODATE)
#endif

include $(PRDEPTH)/PRrules

createleomanager.o:	../api/createleomanager.c
	$(CCF) -c -DINIT_DISK ../api/createleomanager.c
	
cjcreateleomanager.o:	../api/createleomanager.c
	$(CCF) -c -DINIT_JAPAN ../api/createleomanager.c -o $@
	
cacreateleomanager.o:	../api/createleomanager.c
	$(CCF) -c -DINIT_USA ../api/createleomanager.c -o $@
	
#
# bootdisk.c, bootstrap.s は常に -O2 でコンパイルすることにする
# これは、最適化オプションが変わるとルーチンのバイト数が変わり、
# 暗号化の範囲も変わってしまうからである
#

bootdisk.o: ../api/bootdisk.c
	$(CC) -xansi $(LCINCS) $(LCOPTS) -Wab,-r4300_mul -nostdinc -I$(ROOT)/usr/include -O2  -MDupdate Makedepend -woff 515,608,658,799 -c ../api/bootdisk.c -o $@

bootstrap.o: ../api/bootstrap.s
	$(AS) $(LASINCS) $(LASOPTS) -Wab,-r4300_mul -nostdinc -I$(ROOT)/usr/include -O2  -MDupdate Makedepend ../api/bootstrap.s -o $@

install! default