Rev 544 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 361 | andfri | 1 | # Target file name (without extension). |
| 2 | TARGET = main |
||
| 3 | |||
| 470 | arune | 4 | LIBDIR = ../../avr-lib |
| 550 | andfri | 5 | SRCDIR = src |
| 6 | BIOSDIR = bios |
||
| 7 | CFGDIR = . |
||
| 8 | BUILDDIR = build |
||
| 9 | |||
| 470 | arune | 10 | include $(LIBDIR)/system.inc |
| 550 | andfri | 11 | include $(BIOSDIR)/bios.inc |
| 361 | andfri | 12 | |
| 550 | andfri | 13 | MAKEFLAGS += TARGET=$(TARGET) \ |
| 14 | LIBDIR=../$(LIBDIR) \ |
||
| 15 | SRCDIR=../$(SRCDIR) \ |
||
| 16 | BIOSDIR=../$(BIOSDIR) \ |
||
| 17 | CFGDIR=../$(CFGDIR) |
||
| 361 | andfri | 18 | |
| 19 | # Define programs and commands. |
||
| 20 | SHELL = sh |
||
| 21 | CC = avr-gcc |
||
| 468 | arune | 22 | AWK = awk |
| 361 | andfri | 23 | OBJCOPY = avr-objcopy |
| 24 | OBJDUMP = avr-objdump |
||
| 25 | SIZE = avr-size |
||
| 26 | NM = avr-nm |
||
| 550 | andfri | 27 | RM = rm -f |
| 361 | andfri | 28 | COPY = cp |
| 550 | andfri | 29 | MKDIR = mkdir |
| 361 | andfri | 30 | |
| 31 | # Define Messages |
||
| 32 | # English |
||
| 33 | MSG_CLEANING = Cleaning project: |
||
| 550 | andfri | 34 | MSG_CREATEDIR = Creating directory: |
| 361 | andfri | 35 | |
| 36 | |||
| 37 | # Default target. |
||
| 550 | andfri | 38 | all: $(BUILDDIR) |
| 39 | @$(MAKE) -C $(BUILDDIR) -f $(SRCDIR)/Makefile all |
||
| 361 | andfri | 40 | |
| 550 | andfri | 41 | install: $(BUILDDIR)/$(TARGET).hex |
| 42 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -f $< -r |
||
| 361 | andfri | 43 | |
| 472 | arune | 44 | reset: |
| 45 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -r |
||
| 46 | |||
| 47 | start: |
||
| 48 | $(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -s |
||
| 49 | |||
| 550 | andfri | 50 | $(BUILDDIR)/$(TARGET).hex: $(BUILDDIR) |
| 51 | @$(MAKE) -C $(BUILDDIR) -f $(SRCDIR)/Makefile $(TARGET).hex |
||
| 361 | andfri | 52 | |
| 550 | andfri | 53 | $(BUILDDIR): |
| 54 | @echo $(MSG_CREATEDIR) $@ |
||
| 55 | @$(MKDIR) -p $@ |
||
| 361 | andfri | 56 | |
| 57 | # Target: clean project. |
||
| 550 | andfri | 58 | clean: |
| 59 | @$(MAKE) -C $(BUILDDIR) -f $(SRCDIR)/Makefile clean |
||
| 361 | andfri | 60 | |
| 550 | andfri | 61 | distclean: |
| 361 | andfri | 62 | @echo $(MSG_CLEANING) |
| 550 | andfri | 63 | $(RM) -r $(BUILDDIR) |
| 361 | andfri | 64 | |
| 65 | # Listing of phony targets. |
||
| 550 | andfri | 66 | .PHONY : all clean distclean install reset start |
| 361 | andfri | 67 |