########################### # DEFINE COMPILER OPTIONS # ########################### C51PATH = C:C51 CUSTOMER = .customdemo AS = ML AFLAGS = /c LINK = LINK # DB : DEBUG CC = TC # OE : OBJEXTENTED CFLAGS = /c # NOPR : NOPRINT A51 = $(C51PATH)BINA51 # WL(1) : WARNINGLEVEL 1 C51 = $(C51PATH)BINC51 # SB : SYMBOL A51FLAGS = DB NOPR # PP : PREPRINT #C51FLAGS = DB OE NOPR NOAM # PP : PREPRINT C51FLAGS = DB OE NOPR WL(1) NOAM # PP : PREPRINT L51 = $(C51PATH)BINL51 # DS : DEBUGSYMBOLS L51FLAGS = DS DL NOSY NOLI RS(256) OL # DL : DEBUGLINES #L51FLAGS = DS DL NOSY NOLI RS(256) OL NOAM # DL : DEBUGLINES O51 = $(C51PATH)BINOHS51 # NOSY : NOSYMBOLS
################################################################# # Board Config ################################################################# !ifdef MODEL_DEF !include "make.cfg" CUSTOMER_FLAGS = $(CUSTOMER_DEF), $(MODEL_DEF) !elif defined(DO_TINY) CUSTOMER_FLAGS = MTK_TINY !elif defined(DO_SIMPLE) CUSTOMER_FLAGS = MTK_2CH !elif defined(DO_FULL) CUSTOMER_FLAGS = MTK_FULL !elif defined(DO_1379) CUSTOMER_FLAGS = MTK_1379 !elif defined(DO_SIMP79) CUSTOMER_FLAGS = MTK_2CH79 !elif defined(DO_NUI) CUSTOMER_FLAGS = NUI_1379 !elif defined(DO_NUI_S) CUSTOMER_FLAGS = NUI_2CH !elif defined(DO_NUI_B) CUSTOMER_FLAGS = NUI_BAS !endif
################################################################# # Select Servo Library Directory ################################################################# !if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) # MT1379 Rev A,B + MT1336 Rev B #SERVO = .SRV79_36 # MT1379 Rev A,B + MT1336 Rev C #SERVO = .SRV79_36C # MT1379 Rev C + MT1336 Rev C #SERVO = .SRV79C36C SERVO = .SERVOLIB #SERVO = .SERVOLIB_D !else # 1369 SERVO = .SRV69_36 !endif # 1369
################################################################# # Bank Config ################################################################# !ifndef BANK_NO BANK_NO = 4 !endif
################################################################# # Flash Size Setting ################################################################# !ifndef FLASH_SZ FLASH_SZ = 1 !endif
!ifndef FLASH_TYPE FLASH_TYPE = 1 !endif ################################################################# # TV Encoder Config ################################################################# !ifndef TVE_DEF TVE_DEF = _CS4954_ #TVE_DEF = _AV3168_ #TVE_DEF = _AV3169_ #TVE_DEF = _ADV7170_ #TVE_DEF = _ADV7171_ #TVE_DEF = _ADV7176_ !endif
# TVE_PEXSEL is defined according to TVE
################################################################# # Audio DAC Config ################################################################# !ifndef ADAC_DEF
!if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) ADAC_DEF = _WM8756_ !else # 1369 ADAC_DEF = _AV2188_ !endif # 1369
# Right-Justified, 24-bit --> No need to define #ADAC_DEF = _AV2188_ #ADAC_DEF = _AV2388_ #ADAC_DEF = _CS4228_ #ADAC_DEF = _AK4357_ #ADAC_DEF = _WM8746_ #ADAC_DEF = _PCM1602_ #ADAC_DEF = _PCM1604_ #ADAC_DEF = _PCM1605_ #ADAC_DEF = _PCM1742_ #ADAC_DEF = _PCM1748_ #ADAC_DEF = _WM8756_
# Right-Justified, 24-bit --> Non-Programmable ADAC #ADAC_DEF = _CS4336_ #ADAC_DEF = _WM8725_ #ADAC_DEF = _WM8746HW_
# Right-Justified, 18-bit #ADAC_DEF = _CS4330_ #ADAC_DEF = _CS4339_
# Right-Justified, 20-bit #ADAC_DEF = _CS4337_
# Left-Justified, 16-24bit #ADAC_DEF = _CS4335_ #ADAC_DEF = _CS4360_ #ADAC_DEF = _CS4362_ #ADAC_DEF = _CS4391_
# Left-Justified, 24bit #ADAC_DEF = _AK4382_ #ADAC_DEF = _AK4381_
# I2S, 24-bit #ADAC_DEF = _CS4340_ #ADAC_DEF = _WM8728_ #ADAC_DEF = _WM8720_ #ADAC_DEF = _WM8714_ #ADAC_DEF = _PCM1606_
# I2S, 18-bit #ADAC_DEF = _CS4331_
# I2S, 16-24bit #ADAC_DEF = _CS4334_
!endif
################################################################# # I/O Pin Config ################################################################# # Default High--> Mute, Low--> Normal !ifndef MUTE_DEF MUTE_DEF = HIGH_MUTE #MUTE_DEF = LOW_MUTE !endif
!ifndef RESET_DEF !if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) RESET_DEF = USE_1336_RESET #RESET_DEF = USE_1369_RESET #RESET_DEF = USE_1379_RESET #RESET_DEF = USE_1379P31_RESET !else # 1369 #RESET_DEF = USE_1336_RESET RESET_DEF = USE_1369_RESET !endif # 1369 !endif
#################################################### # GENERAL MAKE ROUTINES FOR DIFFERENT CHIP VENDORS # #################################################### # TODO: This is not a good way. Should use module combine. !if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) OBJS = adac.obj ado_in.obj cdvdcmd.obj discinfo.obj drs232.obj hdmi_ctrl.obj hdcp.obj eeprom.obj flash.obj gpioctrl.obj i2c.obj init.obj init1.obj isr.obj ir_recv.obj main.obj post.obj mem.obj misc.obj power.obj miscasm.obj osd8032.obj read.obj servo.obj servopin.obj spi.obj timer.obj tve.obj mv.obj shareinf.obj codec.obj codecext.obj bimrw.obj $(CUSTOMER)vfdvfd_hw.obj l51bank2.obj l51bank4.obj l51bank8.obj startup.obj
INCFILES = version.h general.h typedef.h config.h mt1389.h common.h servo.h $(CUSTOMER)vfdvfd.h $(CUSTOMER)vfdvfd_hw.h $(CUSTOMER)vfdvfd_cus.h $(CUSTOMER)vfdvfd_func.h vardef.h procdef.h macro.h srv2dec.h commonmerge.h dec2srv.h commonshareinf.h commonsv_const.h !else #1369 OBJS = adac.obj cdvdcmd.obj discinfo.obj drs232.obj hdmi_ctrl.obj hdcp.obj eeprom.obj flash.obj gpioctrl.obj i2c.obj init.obj init1.obj isr.obj ir_recv.obj main.obj post.obj mem.obj misc.obj power.obj miscasm.obj osd8032.obj read.obj servo.obj timer.obj tve.obj mv.obj shareinf.obj $(CUSTOMER)vfdvfd_hw.obj l51bank2.obj l51bank4.obj startup.obj
INCFILES = version.h general.h typedef.h config.h mt1369.h common.h servo.h $(CUSTOMER)vfdvfd.h vardef.h procdef.h macro.h srv2dec.h commonmerge.h dec2srv.h commonshareinf.h commonsv_const.h !endif
# - whiteboard description file. !if (defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) WBDESFILES = nuiwb.h nuiwbpub.h !else WBDESFILES = wb.h wbpub.h !endif
################################################################# # Compile Options ################################################################# !if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) #BOARD_FLAGS = BANK_NO=$(BANK_NO),FLASH_SZ=$(FLASH_SZ),$(TVE_DEF),$(MUTE_DEF),$(ADAC_DEF),$(RESET_DEF) BOARD_FLAGS = BANK_NO=$(BANK_NO),FLASH_SZ=$(FLASH_SZ),FLASH_TYPE=$(FLASH_TYPE),$(MUTE_DEF),$(ADAC_DEF),$(RESET_DEF) !else # 1369 BOARD_FLAGS = FLASH_SZ=$(FLASH_SZ),FLASH_TYPE=$(FLASH_TYPE),$(TVE_DEF),$(ADAC_DEF),$(MUTE_DEF),$(RESET_DEF) !endif # 1369
!ifdef CUSTOMER_FLAGS ALL_FLAGS = DF($(BOARD_FLAGS),$(CUSTOMER_FLAGS)) $(C51FLAGS) !else ALL_FLAGS = DF($(BOARD_FLAGS)) $(C51FLAGS) !endif
all : servo_lib $(OBJS) UI SHARE_MEM_CHECKER # $(L51) @link.dat
clean: shm_chk_clean UI_clean -@if exist bimrw.a51 attrib -r bimrw.a51 -@if exist bimrw.a51 del bimrw.a51 -@if exist bimrw.obj attrib +r bimrw.obj -@if exist codec.obj attrib +r codec.obj -@if exist make.cfg del make.cfg -@if exist config.h del config.h -@if exist servo.lib attrib -r servo.lib -@if exist servo.lib del servo.lib -@if exist config.h del config.h -@if exist init1.c del init1.c -@if exist srv2dec.h attrib -r srv2dec.h -@if exist srv2dec.h del srv2dec.h -@if exist commonmerge.h del commonmerge.h -@del *.src -@del *.obj -@del *.omf -@del *.m51 -@del *.hex -@del *.lst -@if exist a. del a. -@del $(CUSTOMER)vfd*.obj -@del $(CUSTOMER)vfd*.tds -@del $(CUSTOMER)vfd*.exe
servo_lib : -@copy /y $(SERVO)$(SRV_LIB).h srv2dec.h -@copy /y $(SERVO)$(SRV_LIB).lib servo.lib
adac.obj : adac.c $(INCFILES) $(C51) adac.c $(ALL_FLAGS)
ado_in.obj : ado_in.c $(INCFILES) $(C51) ado_in.c $(ALL_FLAGS)
cdvdcmd.obj : cdvdcmd.c $(INCFILES) $(C51) cdvdcmd.c $(ALL_FLAGS)
discinfo.obj : discinfo.c $(INCFILES) $(C51) discinfo.c $(ALL_FLAGS)
drs232.obj : drs232.c $(INCFILES) $(C51) drs232.c $(ALL_FLAGS)
hdmi_ctrl.obj : hdmi_ctrl.c $(INCFILES) $(C51) hdmi_ctrl.c $(ALL_FLAGS)
#-@copy /Y /B $(CUSTOMER)hdcphdcp.obj .hdcp.obj -@copy /Y /B $(CUSTOMER)hdcphdcp_NONE.obj .hdcp.obj
eeprom.obj : eeprom.c $(INCFILES) $(C51) eeprom.c $(ALL_FLAGS)
flash.obj : flash.c $(INCFILES) $(C51) flash.c $(ALL_FLAGS)
gpioctrl.obj : gpioctrl.c $(INCFILES) $(C51) gpioctrl.c $(ALL_FLAGS)
i2c.obj : i2c.c $(INCFILES) $(C51) i2c.c $(ALL_FLAGS)
init.obj : init.c $(INCFILES) $(C51) init.c $(ALL_FLAGS)
init1.obj : init1.c $(INCFILES) $(C51) init1.c $(ALL_FLAGS)
isr.obj : isr.c $(INCFILES) $(C51) isr.c $(ALL_FLAGS)
ir_recv.obj : ir_recv.c $(INCFILES) $(CUSTOMER)irkey.c $(C51) ir_recv.c $(ALL_FLAGS)
main.obj : main.c $(INCFILES) $(C51) main.c $(ALL_FLAGS)
post.obj : post.c $(INCFILES) $(C51) post.c $(ALL_FLAGS)
mem.obj : mem.c $(INCFILES) $(C51) mem.c $(ALL_FLAGS)
misc.obj : misc.c $(INCFILES) $(C51) misc.c $(ALL_FLAGS)
power.obj : power.c $(INCFILES) $(C51) power.c $(ALL_FLAGS)
miscasm.obj : miscasm.c51 $(INCFILES) $(C51) miscasm.c51 DF($(BOARD_FLAGS),$(CUSTOMER_FLAGS)) $(C51FLAGS) SRC OT(6) $(A51) miscasm.src $(A51FLAGS)
osd8032.obj : osd8032.c osd8032.h $(INCFILES) $(WBDESFILES) $(C51) osd8032.c $(ALL_FLAGS)
read.obj : read.c $(INCFILES) $(C51) read.c $(ALL_FLAGS)
servo.obj : servo.c $(INCFILES) $(C51) servo.c $(ALL_FLAGS)
servopin.obj : servopin.c $(INCFILES) $(C51) servopin.c $(ALL_FLAGS)
spi.obj : spi.c $(INCFILES) $(C51) spi.c $(ALL_FLAGS)
timer.obj : timer.c $(INCFILES) $(C51) timer.c $(ALL_FLAGS)
tve.obj : tve.c $(INCFILES) $(C51) tve.c $(ALL_FLAGS)
codecext.obj : codecext.c $(INCFILES) $(C51) codecext.c $(ALL_FLAGS)
mv.obj : !if ("$(TVE_DEF)" == "_CS4954_") -@copy /Y /B $(CUSTOMER)mvcs4954.obj .mv.obj !elseif ("$(TVE_DEF)" == "_AV3168_") -@copy /Y /B $(CUSTOMER)mvav3168.obj .mv.obj !elseif ("$(TVE_DEF)" == "_AV3169_") -@copy /Y /B $(CUSTOMER)mvav3169.obj .mv.obj !elseif ("$(TVE_DEF)" == "_ADV7170_") -@copy /Y /B $(CUSTOMER)mvad7170.obj .mv.obj !elseif ("$(TVE_DEF)" == "_ADV7171_") -@copy /Y /B $(CUSTOMER)mvad7170.obj .mv.obj !elseif ("$(TVE_DEF)" == "_ADV7176_") -@copy /Y /B $(CUSTOMER)mvad7176.obj .mv.obj !endif
shareinf.obj : shareinf.c $(INCFILES) $(C51) shareinf.c $(ALL_FLAGS)
l51bank2.obj : l51bank2.a51 $(A51) l51bank2.a51 $(A51FLAGS)
l51bank4.obj : l51bank4.a51 $(A51) l51bank4.a51 $(A51FLAGS)
l51bank8.obj : l51bank8.a51 $(A51) l51bank8.a51 $(A51FLAGS)
startup.obj : startup.a51 !if (defined(DO_1379) || defined(DO_SIMP79) || defined(DO_NUI) || defined(DO_NUI_S) || defined(DO_NUI_B)) $(A51) startup.a51 db SET(BANK_NO=$(BANK_NO),FLASH_SZ=$(FLASH_SZ)) !else $(A51) startup.a51 db !endif
$(CUSTOMER)vfdvfd_hw.obj : $(CUSTOMER)vfdvfd_hw.c $(INCFILES) -@cd $(CUSTOMER) $(C51) .vfdvfd_hw.c $(ALL_FLAGS) -@cd .. -@cd ..
UI : -@cd $(CUSTOMER) !ifdef DO_NUI -@$(C51PATH)BINmake C51PATH=$(C51PATH) CUSTOMER_FLAGS="$(CUSTOMER_FLAGS)" DO_NUI=1 all !elif defined(DO_NUI_S) -@$(C51PATH)BINmake C51PATH=$(C51PATH) CUSTOMER_FLAGS="$(CUSTOMER_FLAGS)" DO_NUI_S=1 all !elif defined(DO_NUI_B) -@$(C51PATH)BINmake C51PATH=$(C51PATH) CUSTOMER_FLAGS="$(CUSTOMER_FLAGS)" DO_NUI_B=1 all !elif defined(CUSTOMER_FLAGS) -@$(C51PATH)BINmake C51PATH=$(C51PATH) CUSTOMER_FLAGS="$(CUSTOMER_FLAGS)" all !else -@$(C51PATH)BINmake C51PATH=$(C51PATH) all !endif -@cd .. -@cd ..
UI_clean : -@cd $(CUSTOMER) -@del *.lib -@$(C51PATH)BINmake C51PATH=$(C51PATH) clean -@cd .. -@cd ..
SHARE_MEM_CHECKER : shm_chk.c $(INCFILES) -@if exist %BCC5PATH%BINcc32.exe %BCC5PATH%BINcc32 -6 -I%BCC5PATH%INCLUDE -L%BCC5PATH%LIB -D$(CUSTOMER_FLAGS) shm_chk.c -eshm_chk.exe shm_chk.c -@if exist shm_chk.txt attrib -r shm_chk.txt -@if exist shm_chk.txt del shm_chk.txt -@if exist shm_chk.exe shm_chk.exe
shm_chk_clean: -@if exist shm_chk.exe del shm_chk.exe -@if exist shm_chk.tds del shm_chk.tds -@if exist shm_chk.obj del shm_chk.obj -@if exist shm_chk.txt del shm_chk.txt |