Rev 903 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 801 | linlun | 1 | # Target file name (without extension). |
| 2 | TARGET = main |
||
| 3 | BIOSTARGET = bios |
||
| 4 | |||
| 5 | LIBDIR = ../../avr-lib |
||
| 6 | SRCDIR = src |
||
| 819 | migan | 7 | MODDIR = modules |
| 801 | linlun | 8 | CFGDIR = . |
| 817 | migan | 9 | #MODDIR = modules |
| 801 | linlun | 10 | BIOSDIR = bios |
| 11 | BIOSSRCDIR = $(LIBDIR)/bios |
||
| 12 | BUILDDIR = build |
||
| 13 | |||
| 14 | include bios.inc |
||
| 15 | include ../system.inc |
||
| 817 | migan | 16 | #include modules.inc |
| 801 | linlun | 17 | |
| 18 | APPMAKEFLAGS = TARGET=$(TARGET) \ |
||
| 19 | LIBDIR=$(abspath $(LIBDIR)) \ |
||
| 20 | SRCDIR=$(abspath $(SRCDIR)) \ |
||
| 21 | BIOSDIR=$(abspath $(BIOSDIR)) \ |
||
| 22 | CFGDIR=$(abspath $(CFGDIR)) |
||
| 23 | |||
| 24 | BIOSMAKEFLAGS = TARGET=$(BIOSTARGET) \ |
||
| 25 | LIBDIR=$(abspath $(LIBDIR)) \ |
||
| 26 | SRCDIR=$(abspath $(BIOSSRCDIR)) \ |
||
| 27 | CFGDIR=$(abspath $(CFGDIR)) |
||
| 28 | |||
| 29 | # Define Messages |
||
| 30 | # English |
||
| 31 | MSG_CLEANING = Cleaning project: |
||
| 32 | MSG_CREATEDIR = Creating directory: |
||
| 33 | |||
| 34 | |||
| 35 | # Default target. |
||
| 891 | arune | 36 | all: check_binaries $(abspath $(BUILDDIR)) |
| 801 | linlun | 37 | @$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) all |
| 38 | |||
| 891 | arune | 39 | bios: check_binaries $(abspath $(BIOSDIR)) |
| 801 | linlun | 40 | @$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) all |
| 41 | |||
| 42 | installbios: bios |
||
| 43 | $(UPLOAD) $(ULFLAGS) |
||
| 44 | |||
| 45 | upgradebios: bios |
||
| 46 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $(BIOSDIR)/$(BIOSTARGET).hex -r -b |
||
| 47 | |||
| 48 | install: $(BUILDDIR)/$(TARGET).hex |
||
| 49 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $< -r |
||
| 50 | |||
| 51 | reset: |
||
| 52 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -r |
||
| 53 | |||
| 54 | start: |
||
| 55 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -s |
||
| 56 | |||
| 891 | arune | 57 | $(BUILDDIR)/$(TARGET).hex: check_binaries $(abspath $(BUILDDIR)) |
| 801 | linlun | 58 | @$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) $(TARGET).hex |
| 59 | |||
| 891 | arune | 60 | $(abspath $(BUILDDIR) $(BIOSDIR)): check_binaries |
| 801 | linlun | 61 | @echo $(MSG_CREATEDIR) $@ |
| 62 | @$(MKDIR) -p $@ |
||
| 63 | |||
| 64 | # Target: clean project. |
||
| 891 | arune | 65 | clean: check_binaries |
| 801 | linlun | 66 | @$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) clean |
| 67 | |||
| 891 | arune | 68 | cleanbios: check_binaries |
| 801 | linlun | 69 | @$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) clean |
| 70 | |||
| 891 | arune | 71 | distclean: check_binaries |
| 801 | linlun | 72 | @echo $(MSG_CLEANING) |
| 73 | $(RM) -r $(BUILDDIR) |
||
| 74 | $(RM) -r $(BIOSDIR) |
||
| 75 | |||
| 903 | arune | 76 | sethwid: |
| 77 | @$(PERL) ../../../../PcSoftware/scripts/SetHwId/SetHwId.pl |
||
| 78 | |||
| 891 | arune | 79 | check_binaries: |
| 80 | ifndef MKDIR |
||
| 81 | @echo |
||
| 82 | @echo ERROR! This is because you have not defined build-binaries in system.inc |
||
| 83 | @echo Please update system.inc.template from SVN and then copy the build binaries definitions to your system.inc |
||
| 84 | @echo |
||
| 85 | @false |
||
| 86 | endif |
||
| 87 | |||
| 801 | linlun | 88 | # Listing of phony targets. |
| 89 | .PHONY : all bios installbios upgradebios \ |
||
| 90 | install reset start \ |
||
| 903 | arune | 91 | clean cleanbios distclean check_binaries sethwid |
| 801 | linlun | 92 |