Makefile 1.46 KB
#!smake -k
#
# Makefile for hello demo application 
#
#

DDPROCDIR = ../ddproc
PRDEPTH = ../../..
include $(ROOT)/usr/include/make/PRdefs
MAKEDISK = $(ROOT)/usr/sbin/makedisk

#FINAL =

#ifdef FINAL
OPTIMIZER       = -O2
LCDEFS          =
N64LIB          = -lleo -lultra_rom
ARGS            = FINAL=  
#else
OPTIMIZER       = -g
LCDEFS          = -DDEBUG
N64LIB          = -lleo_d -lultra_d
#endif

APP =		hello

TARGETS =	hello.rom

HFILES =	hello_world.h hmain.h

CODEFILES   =	hello_world.c dram_stack.c rdp_output.c rdp_output_len.c \
				dd_proc.c static.c 

CODEOBJECTS =	$(CODEFILES:.c=.o)

DATAFILES   =	cfb.c rsp_cfb.c

DATAOBJECTS =	$(DATAFILES:.c=.o)

DDPROCOBJECT = ddproc.o
CODESEGMENT =	codesegment.o

OBJECTS =	$(CODESEGMENT) $(DATAOBJECTS)

LCINCS =	-I. -I$(ROOT)/usr/include/PR -I$(ROOT)/usr/include \
		-I$(DDPROCDIR)
LCOPTS =	-fullwarn -non_shared -G 0 -Xcpluscomm

LDIRT  =	$(APP) $(TARGETS) gwrite

LDFLAGS =	$(MKDEPOPT) -nostdlib -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
		$(N64LIB)

default:	$(TARGETS)

include $(COMMONRULES)

install:	default
		$(INSTALL) -m 444 -F /usr/src/PR/demos/reboot/hello_world	\
			$(CODEFILES) $(DATAFILES) $(HFILES) Makefile spec

$(CODESEGMENT):	$(CODEOBJECTS) $(DDPROCOBJECT)
		$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS)  $(DDPROCOBJECT) $(LDFLAGS)

$(TARGETS) $(APP): spec $(OBJECTS)
	$(MAKEDISK) -t 0 -R $(TARGETS) -S gwrite spec 

ddproc.o $(DDPROCDIR)/ddproc2.o :
	(cd $(DDPROCDIR);$(MAKE) $(ARGS)); 
	cp $(DDPROCDIR)/ddproc2.o ./ddproc.o