put object files in OBJDIR
This commit is contained in:
parent
8c6336ab52
commit
e88fad5cdd
1 changed files with 17 additions and 8 deletions
|
@ -19,25 +19,34 @@ ARCH = arm
|
||||||
CPU = arm7tdmi-s
|
CPU = arm7tdmi-s
|
||||||
export ARCH CPU VENDOR
|
export ARCH CPU VENDOR
|
||||||
|
|
||||||
%.s: %.S
|
.SECONDARY:
|
||||||
$(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
|
|
||||||
%.o: %.S
|
$(START): $(START:.o=.s)
|
||||||
$(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
|
$(CC) $(AFLAGS) -c -o $@ $<
|
||||||
%.o: %.c
|
|
||||||
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
$(ISR): $(ISR:.o=.c)
|
$(ISR): $(ISR:.o=.c)
|
||||||
$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
|
$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
|
||||||
|
|
||||||
%.elf: $(START) $(ISR) %.o $(LINKERSCRIPT)
|
%_$(BOARD).elf: %.elf
|
||||||
|
mv $< $@
|
||||||
|
|
||||||
|
%.elf: $(START) $(ISR) $(OBJDIR)/%.o $(LINKERSCRIPT) board
|
||||||
$(LD) $(LDFLAGS) $(AOBJS) \
|
$(LD) $(LDFLAGS) $(AOBJS) \
|
||||||
--start-group $(PLATFORM_LIBS) --end-group \
|
--start-group $(PLATFORM_LIBS) --end-group \
|
||||||
$(filter %.o %.a,$+) -o $@
|
$(filter %.o %.a,$+) -o $@
|
||||||
|
|
||||||
|
$(OBJDIR)/%.s: %.S
|
||||||
|
$(CPP) $(AFLAGS) -o $@ $<
|
||||||
|
$(OBJDIR)/%.o: %.S
|
||||||
|
$(CC) $(AFLAGS) -c -o $@ $<
|
||||||
|
$(OBJDIR)/%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
find $(MC1322X) -type f \
|
find $(MC1322X) -type f \
|
||||||
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
||||||
-o -name '*.o' -o -name '*.a' -o -name '*.obj' -o -name '*.elf' \) -print \
|
-o -name '*.o' -o -name '*.a' -o -name '*.obj' -o -name '*.elf' -o -name '*.s' -o -name '*.map' \) -print \
|
||||||
| xargs rm -f
|
| xargs rm -f
|
||||||
rm -fr *.*~
|
rm -fr *.*~
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue