Date:2011-06-26 11:56:01 (8 years 2 months ago)
Author:Werner Almesberger
Commit:6909fc232a92dbba9e90c835b6ad9ee5110cf3c3
Message:atusb/fw/Makefile: introduce target-specific compliation variants

- Makefile (USB_OBJS): moved into OBJS and BOOT_OBJS
- Makefile (OBJS): atu2.o is now app-atu2.o
- Makefile (BOOT_OBJS): atu2.o is now boot-atu2.o
- Makefile (MKDEP, %.o): moved dependency generation to macro $(MKDEP)
- Makefile (app-%.o): build from usb/%.c
- Makefile (boot -%.o): build from usb/%.c and set -DBOOT_LOADER
Files: atusb/fw/Makefile (2 diffs)

Change Details

atusb/fw/Makefile
3030
3131USB_ID = 20b7:1540
3232
33USB_OBJS = usb.o atu2.o
34OBJS = atusb.o board.o board_app.o sernum.o spi.o descr.o ep0.o dfu_common.o \
35       $(USB_OBJS)
36BOOT_OBJS = boot.o board.o sernum.o spi.o flash.o dfu.o dfu_common.o \
37        $(USB_OBJS)
33OBJS = atusb.o board.o board_app.o sernum.o spi.o descr.o ep0.o \
34       dfu_common.o usb.o app-atu2.o
35BOOT_OBJS = boot.o board.o sernum.o spi.o flash.o dfu.o \
36            dfu_common.o usb.o boot-atu2.o
3837
3938vpath %.c usb/
4039
...... 
110109
111110# ----- Dependencies ----------------------------------------------------------
112111
112MKDEP = \
113    $(DEPEND) $< | \
114      sed \
115        -e 's|^$(basename $(notdir $<)).o:|$@:|' \
116        -e '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
117        -e '$${g;p;}' \
118        -e d >$(basename $@).d; \
119      [ "$${PIPESTATUS[*]}" = "0 0" ] || \
120      { rm -f $(basename $@).d; exit 1; }
121
113122%.o: %.c
114123        $(CC) $(CFLAGS) -Os -c $<
115        $(DEPEND) $< | \
116          sed -e \
117            '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
118            -e '$${g;p;}' -e d >$*.d; \
119          [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
124        $(MKDEP)
120125
121126-include $(OBJS:.o=.d)
122127
128# ----- Object file variants --------------------------------------------------
129
130app-%.o: usb/%.c
131        $(CC) $(CFLAGS) -Os -o $@ -c $<
132        $(MKDEP)
133
134boot-%.o: usb/%.c
135        $(CC) $(CFLAGS) -DBOOT_LOADER -Os -o $@ -c $<
136        $(MKDEP)
137
123138# ----- Programming and device control ----------------------------------------
124139
125140upload: $(NAME).bin boot.hex

Archive Download the corresponding diff file



interactive