view 3rdparty/drivers/mmc/makefile @ 2758:e4a0f58a5f9b

Found that people who do not have the envirornment variable NITROS9DIR set before building the project get a error missing file "/rules.mak". Found this is caused do to the fact that the code to set this envirornment variable is in the rules.mak which can't get loaded. To fix this the code needed to set the envirornment variable that is in the rules.mak is now in the makefile(s) right before the include for the rules.mak file. This should fix the problem for those who do not have the NITROS9DIR envirornment variable preset.
author drencor-xeen
date Mon, 14 Jan 2013 14:37:46 -0600
parents aa2a7c7dd3ec
children 1addfd8c9d5f
line wrap: on
line source

# Jim Hathaway's MultiMediaCard NitrOS-9 driver

ifndef  NITROS9DIR
NITROS9DIR      = $(HOME)/nitros9
endif
include $(NITROS9DIR)/rules.mak

DEPENDS		= ./makefile
DRVRS		= mmcdrv_l1.dr mmcdrv_l2.dr mmcdrv_l1s.dr mmcdrv_l2s.dr 
DESCS		= h0_mmc_l1.dd h0_mmc_l2.dd h1_mmc_l1.dd h1_mmc_l2.dd dd_mmc_l1.dd dd_mmc_l2.dd
ALLOBJS		= $(DRVRS) $(DESCS)
MMCL1FLAGS	= $(AFLAGS) -aLevel=1
MMCL2FLAGS	= $(AFLAGS) -aLevel=2

all:	$(ALLOBJS) $(DEPENDS)

# Drivers - optimized for speed over size
mmcdrv_l1.dr: mmcdrv.asm
	$(AS) $(ASOUT)$@ $< $(MMCL1FLAGS)

mmcdrv_l2.dr: mmcdrv.asm
	$(AS) $(ASOUT)$@ $< $(MMCL2FLAGS)

# Drivers - optimized for size over speed

mmcdrv_l1s.dr: mmcdrv.asm
	$(AS) $(ASOUT)$@ $< $(MMCL1FLAGS) -aSMALLC=1

mmcdrv_l2s.dr: mmcdrv.asm
	$(AS) $(ASOUT)$@ $< $(MMCL2FLAGS) -aSMALLC=1

# Descriptors
# ITDRV is the Drive 0 or 1 switch for device descriptors
h0_mmc_l1.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL1FLAGS) -aITDRV=0

h0_mmc_l2.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL2FLAGS) -aITDRV=0

h1_mmc_l1.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL1FLAGS) -aITDRV=1

h1_mmc_l2.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL2FLAGS) -aITDRV=1

dd_mmc_l1.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL1FLAGS) -aITDRV=0 -aDD=1

dd_mmc_l2.dd: mmcdesc.asm
	$(AS) $(ASOUT)$@ $< $(MMCL2FLAGS) -aITDRV=0 -aDD=1

clean:
	$(RM) $(ALLOBJS)