############################################################################### # # makefile_pc for use with PC mksnt tools dink32 # $Id: makefile_pc,v 1.9 1999/11/29 23:00:57 maurie Exp $ # # # Copyright Motorola, Inc. 1993, 1994 # ALL RIGHTS RESERVED # # You are hereby granted a copyright license to use, modify, and # distribute the SOFTWARE so long as this entire notice is retained # without alteration in any modified and/or redistributed versions, # and that such modified versions are clearly identified as such. # No licenses are granted by implication, estoppel or otherwise under # any patents or trademarks of Motorola, Inc. # # The SOFTWARE is provided on an "AS IS" basis and without warranty. # To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS # ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED # WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR # PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH # REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS # THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS. # # To the maximum extent permitted by applicable law, IN NO EVENT SHALL # MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF # BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. Motorola assumes no responsibility # for the maintenance and support of the SOFTWARE. # # Usage: \mksnt\make -f makefile_pc [dink|mdink|clean|clean_release] MAKE = make -f makefile_pc DINKDIR = ./dink_dir MDINKDIR= ./mdink_dir BBDIR = ./bb_dir DRIVER_INC = -I./drivers DEBUG = OPTIM = OPT1 = -Hnocopyr -c -Hsds -Hon=Char_default_unsigned OPT2 = -Hon=Char_is_rep -Hon=Use_eieio_for_loads OPT3 = -I$(@D) -I/m:tools/metaware/inc CC = m:/tools/metaware/bin/hcppc $(OPT1) $(OPT2) $(OPT3) CCobj = $(CC) $(DEBUG) $(OPTIM) $(DRIVER_INC) PREP = $(CC) -P -Hasmcpp # Assembler used to build the .s files (for the board version) ASOPT = -big_si ASDEBUG = -l -fm AS = m:/tools/metaware/bin/asppc -c $(ASOPT) -I./$(@D) # Linker to bring .o files together into an executable. LIBS = m:/tools/metaware/lib/be/fp/libct.a m:/tools/metaware/lib/be/fp/libmwt.a LKOPT = -Bbase=0 -xm -e system_reset -Bnoheader -Bhardalign \ -xo=$(@) -q -Qn -Cglobals -Csections -Csymbols -Ccrossref LINK = m:/tools/metaware/bin/ldppc $(LKOPT) > $(@D)/xref.txt # DOS Utilities DEL = rm COPY = cp LIST = ls -l RENM = mv BENCHMARK = bench_mrk.o # Benchmark command REGISTERS = reg_tb.o reg_spr.o# # DINK's registers MEMORY = mem_tb.o# # memory access routines ERRORS = errors.o err_tb.o# # error checking & reporting DOWNLOAD = downld.o dc_tb.o# # downloader with compression routines INPUTOUTPUT = duart.o board.o# # Input/output at board level ASMDSM = asm.o dsm.o kahlua.o mpc107.o# # Dink's assembler/disassembler EXCEPTIONS = except2.o except1.o# # exceptions in DINK32 systems MISC = help.o brk_pts.o # help and breakpoints DINKMAIN = main.o print.o history.o# # main loop and initialization GOTRACE = go_tr1.o go_tr2.o reg_swap.o# # Go and Trace routines PARSER = tok_tb.o arg_tb.o rfs_tb.o par_tb.o toks.o# # DINK parser PCILIB = pciLib.o FLASH = fl.o # flash related routines DEVICE = device.o XOPTS = pmc.o tau.o env.o meminfo.o xio.o # # # DINKASM = $(EXCEPTIONS) $(GOTRACE) DINKWORKERS = $(REGISTERS) $(MEMORY) $(DOWNLOAD) $(ASMDSM) $(BENCHMARK) $(MISC) $(FLASH) $(XOPTS) DINKINTERFACE = $(PARSER) $(ERRORS) $(INPUTOUTPUT) $(PCILIB) $(DEVICE) DINKOBJECTS = $(DINKASM) $(DINKMAIN) $(DINKWORKERS) $(DINKINTERFACE) MDINKOBJECTS = except2.o $(DINKMAIN) $(DOWNLOAD) $(GOTRACE) $(PARSER) \ $(ERRORS) $(INPUTOUTPUT) $(MEMORY) $(REGISTERS) fl.o mhelp.o \ kahlua.o mpc107.o # sublib.o DCOMPOBJECTS = dc_tb_unix.o dc_unix.o DINK_FOBJECTS= $(DINKOBJECTS:^"./dink_dir/" DINK_BBOBJECTS= $(DINKOBJECTS:^"./bb_dir/" DINK_MOBJECTS= $(MDINKOBJECTS:^"./mdink_dir/" $(DINKDIR) \ $(MDINKDIR) \ $(BBDIR): mkdir $@ # Make target directory dink: $(DINKDIR) FORCE $(DINKDIR)/dink32.src bb: $(BBDIR) FORCEBB $(BBDIR)/dink32.src mdink: $(MDINKDIR) FORCEM $(MDINKDIR)/mdink32.src FORCE: history.c $(DEL) -f $(DINKDIR)/history.o FORCEBB: history.c $(DEL) -f $(DINKBB)/history.o FORCEM: history.c $(DEL) -f $(MDINKDIR)/history.o driver: (cd drivers;$(MAKE) $@) $(DINKDIR)/dink32.src : driver $(DINK_FOBJECTS) $(LINK) $(DINK_FOBJECTS) $(LIBS) ./drivers/alldriver.o -o $(@D)/dink32 # $(LINK) $(DINK_FOBJECTS) $(LIBS) -o $(@D)/dink32 $(MDINKDIR)/mdink32.src : $(DINK_MOBJECTS) $(LINK) $(DINK_MOBJECTS) $(LIBS) -o $(@D)/mdink32 $(BBDIR)/dink32.src : $(DINK_BBOBJECTS) $(LINK) $(DINK_BBOBJECTS) $(LIBS) -o $(@D)/dink32 clean: @for i in $(DINKDIR) $(MDINKDIR) $(BBDIR); \ do \ if [ -d $$i ]; \ then \ ( cd $$i; $(DEL) -f *.o *.lst *.i *.map dink32 dink32.src ); \ fi; \ done (cd drivers; $(MAKE) $@) clean_release: @for i in $(DINKDIR) $(MDINKDIR) $(BBDIR); \ do \ if [ -d $$i ]; \ then \ ( cd $$i; $(DEL) -f asm.o bench_mrk.o dsm.o except1.o \ except2.o go_tr1.o go_tr2.o history.o kahlua.o \ main.o print.o reg_swap.o xref.txt *.h *.lst *.i \ *.map dink32 dink32.src mdink32 mdink32.src); \ fi; \ done (cd drivers; $(MAKE) clean) tch: @for i in $(DINKDIR) $(MDINKDIR) $(BBDIR); \ do \ if [ -d $$i ]; \ then \ ( cd $$i; touch arg_tb.o board.o brk_pts.o dc_tb.o device.o \ downld.o duart.o err_tb.o errors.o fl.o help.o mem_tb.o \ par_tb.o pciLib.o reg_spr.o reg_tb.o rfs_tb.o tok_tb.o \ toks.o ); \ fi; \ done .s.o: $(DEL) -f $*.i $(PREP) $< $(AS) $*.i # $(AS) $(ASDEBUG) $*.i > $*.lst .c.o: $(CCobj) $*.c INC_ALL = config.h INC_C = dink.h INC_TOK = tok_tb.h toks.h INC_GEN = errors.h cpu.h INC_ASM = dink_asm.h bigbend.h INC_HISTORY = history.h $(DINKDIR)/fl.o \ $(MDINKDIR)/fl.o \ $(BBDIR)/fl.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) fl.c fl.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/bench_mrk.o \ $(BBDIR)/bench_mrk.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) bench_mrk.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/reg_tb.o \ $(MDINKDIR)/reg_tb.o \ $(BBDIR)/reg_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) reg_tb.c reg_tb.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/reg_spr.o \ $(MDINKDIR)/reg_spr.o \ $(BBDIR)/reg_spr.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) reg_spr.c reg_tb.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/arg_tb.o \ $(MDINKDIR)/arg_tb.o \ $(BBDIR)/arg_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) arg_tb.c rfs_tb.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/mem_tb.o \ $(MDINKDIR)/mem_tb.o \ $(BBDIR)/mem_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) $(INC_GEN) mem_tb.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/tok_tb.o \ $(MDINKDIR)/tok_tb.o \ $(BBDIR)/tok_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) tok_tb.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/rfs_tb.o \ $(MDINKDIR)/rfs_tb.o \ $(BBDIR)/rfs_tb.o: $(INC_ALL) $(INC_C) $(INC_GEN) rfs_tb.c rfs_tb.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/par_tb.o \ $(BBDIR)/par_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) par_tb.c errors.h \ command_tb.h reg_spr.h reg_memmap.h $(CCobj) $(@:b).c -o $@ $(MDINKDIR)/par_tb.o: $(INC_ALL) $(INC_C) $(INC_TOK) mpar_tb.c errors.h \ reg_spr.h reg_memmap.h $(CCobj) mpar_tb.c -o $@ $(DINKDIR)/toks.o \ $(MDINKDIR)/toks.o \ $(BBDIR)/toks.o: $(INC_ALL) $(INC_C) $(INC_TOK) toks.c errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/err_tb.o \ $(MDINKDIR)/err_tb.o \ $(BBDIR)/err_tb.o : $(INC_ALL) $(INC_C) $(INC_TOK) err_tb.c err_tb.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/errors.o \ $(MDINKDIR)/errors.o \ $(BBDIR)/errors.o : $(INC_ALL) $(INC_C) $(INC_GEN) errors.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/help.o \ $(MDINKDIR)/help.o \ $(BBDIR)/help.o : $(INC_ALL) $(INC_C) $(INC_TOK) help.c \ arg_tb.h rfs_tb.h errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/mhelp.o \ $(MDINKDIR)/mhelp.o \ $(BBDIR)/mhelp.o : $(INC_ALL) $(INC_C) $(INC_TOK) mhelp.c \ errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/pmc.o \ $(MDINKDIR)/pmc.o \ $(BBDIR)/pmc.o : $(INC_ALL) $(INC_C) $(INC_TOK) pmc.c \ arg_tb.h rfs_tb.h errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/env.o \ $(BBDIR)/env.o : $(INC_ALL) $(INC_C) $(INC_TOK) env.c \ arg_tb.h rfs_tb.h errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/tau.o \ $(BBDIR)/tau.o : $(INC_ALL) $(INC_C) $(INC_TOK) tau.c \ arg_tb.h rfs_tb.h errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/meminfo.o \ $(BBDIR)/meminfo.o : $(INC_ALL) $(INC_C) $(INC_TOK) meminfo.c \ arg_tb.h errors.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/xio.o \ $(BBDIR)/xio.o : $(INC_ALL) $(INC_C) $(INC_TOK) xio.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/brk_pts.o \ $(BBDIR)/brk_pts.o : $(INC_ALL) $(INC_C) $(INC_GEN) brk_pts.c brk_pts.h $(CCobj) $(@:b).c -o $@ #$(DINKDIR)/sublib.o \ #$(MDINKDIR)/sublib.o \ #$(BBDIR)/sublib.o : $(INC_ALL) $(INC_C) $(INC_GEN) sublib.c # $(CCobj) $(@:b).c -o $@ $(DINKDIR)/except1.o \ $(MDINKDIR)/except1.o \ $(BBDIR)/except1.o : $(INC_ALL) $(INC_C) except1.c $$(@D)/board.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/except2.o \ $(MDINKDIR)/except2.o \ $(BBDIR)/except2.o : $(INC_ALL) $(INC_ASM) except2.s \ $$(@D)/board.h $(DEL) -f $(@D)/$(@:b).i $(PREP) $(@:b).s $(RENM) $(@:b).i $(@D) $(AS) $(@D)/$(@:b).i -o $@ $(AS) $(ASDEBUG) $(@D)/$(@:b).i > $(@D)/$(@B:%.o=%.lst) $(MDINKDIR)/kahlua.o \ $(DINKDIR)/kahlua.o : kahlua.s $$(@D)/board.h dink_asm.h $(DEL) -f $(@D)/$(@:b).i $(PREP) $(@:b).s $(RENM) $(@:b).i $(@D) $(AS) $(@D)/$(@:b).i -o $@ $(MDINKDIR)/mpc107.o \ $(DINKDIR)/mpc107.o : mpc107.s $$(@D)/board.h dink_asm.h $(DEL) -f $(@D)/$(@:b).i $(PREP) $(@:b).s $(RENM) $(@:b).i $(@D) $(AS) $(@D)/$(@:b).i -o $@ $(DINKDIR)/go_tr2.o \ $(MDINKDIR)/go_tr2.o \ $(BBDIR)/go_tr2.o : $(INC_ALL) $(INC_ASM) go_tr2.s spr_loc.h $(DEL) -f $(@D)/$(@:b).i $(PREP) $(@:b).s $(RENM) $(@:b).i $(@D) $(AS) $(@D)/$(@:b).i -o $@ $(DINKDIR)/go_tr1.o \ $(MDINKDIR)/go_tr1.o \ $(BBDIR)/go_tr1.o : $(INC_ALL) $(INC_C) go_tr1.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/reg_swap.o \ $(MDINKDIR)/reg_swap.o \ $(BBDIR)/reg_swap.o : $(INC_ALL) $(INC_ASM) reg_swap.s spr_loc.h $(DEL) -f $(@D)/$(@:b).i $(PREP) $(@:b).s $(RENM) $(@:b).i $(@D) $(AS) $(@D)/$(@:b).i -o $@ $(DINKDIR)/dc_tb.o \ $(MDINKDIR)/dc_tb.o \ $(BBDIR)/dc_tb.o : $(INC_ALL) $(INC_C) $(INC_GEN) dc_tb.c symtab.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/downld.o \ $(MDINKDIR)/downld.o \ $(BBDIR)/downld.o : $(INC_ALL) $(INC_C) $(INC_GEN) downld.c $(CCobj) $(@:b).c -o $@ $(MDINKDIR)/duart.o \ $(DINKDIR)/duart.o : $(INC_ALL) $(INC_C) $(INC_GEN) ykduart.c duart.h $(CCobj) ykduart.c -o $@ $(BBDIR)/duart.o: $(INC_ALL) $(INC_C) $(INC_GEN) bbduart.c duart.h $(CCobj) bbduart.c -o $@ $(DINKDIR)/print.o \ $(MDINKDIR)/print.o \ $(BBDIR)/print.o : $(INC_ALL) $(INC_C) $(INC_GEN) print.c $(CCobj) $(@:b).c -o $@ $(MDINKDIR)/board.o\ $(DINKDIR)/board.o : $(INC_ALL) $(INC_C) $(INC_GEN) yk.c duart.h $$(@D)/board.h $(CCobj) yk.c -o $@ $(BBDIR)/board.o : $(INC_ALL) $(INC_C) $(INC_GEN) bb.c duart.h $$(@D)/board.h $(CCobj) bb.c -o $@ $(DINKDIR)/asm.o \ $(BBDIR)/asm.o : $(INC_ALL) $(INC_C) $(INC_GEN) asm.c asm_dsm.h symtab.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/dsm.o \ $(BBDIR)/dsm.o : $(INC_ALL) $(INC_C) $(INC_GEN) dsm.c asm_dsm.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/pciLib.o \ $(BBDIR)/pciLib.o : pciLib.c pciLib.h errors.h dink.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/device.o \ $(BBDIR)/device.o : device.c $(CCobj) $(@:b).c -o $@ $(DINKDIR)/main.o \ $(MDINKDIR)/main.o \ $(BBDIR)/main.o : $(INC_ALL) $(INC_C) $(INC_TOK) main.c $$(@D)/board.h\ errors.h arg_tb.h reg_tb.h duart.h asm_dsm.h atu.h $(CCobj) $(@:b).c -o $@ $(DINKDIR)/history.o \ $(MDINKDIR)/history.o \ $(BBDIR)/history.o : $(INC_HISTORY) history.c $(CCobj) $(@:b).c -o $@ #======================================================== $(MDINKDIR)/board.h \ $(DINKDIR)/board.h : yellowknife.h cp yellowknife.h $@ $(DINKDIR)/command_tb.h : fcommand_tb.h cp fcommand_tb.h $@ $(BBDIR)/board.h : bigbend.h cp bigbend.h bb_dir/board.h