prevented creation of config.mk files in subdirectories

This commit is contained in:
Christian Kroll 2014-03-20 01:23:36 +01:00
parent 0ba373e103
commit 013cf7c8d5
2 changed files with 23 additions and 18 deletions

View File

@ -168,27 +168,26 @@ test:
##############################################################################
clean:
$(MAKE) -f rules.mk no_deps=t clean-common
$(RM) $(TARGET) $(TARGET).bin $(TARGET).hex $(TARGET).lst .subdirs
$(RM) -f $(TARGET) $(TARGET).bin $(TARGET).hex $(TARGET).lst .subdirs
$(RM) -f $(TARGET).map
for subdir in `find . -type d` ; do \
test "x$$subdir" != "x." \
&& test -e $$subdir/Makefile \
&& $(MAKE) no_deps=t -C $$subdir clean ; done ; true
$(RM) -r $(TOPDIR)/obj_avr
$(RM) -r $(TOPDIR)/obj_sim
$(RM) $(TARGET)*
$(RM) $(TARGET_SIM) $(TARGET_SIM).exe
$(RM) -fr $(TOPDIR)/obj_avr $(TOPDIR)/obj_sim
$(RM) -f $(TARGET_SIM) $(TARGET_SIM).exe
mrproper:
$(MAKE) clean
$(RM) -f $(TOPDIR)/autoconf.h .config config.mk .menuconfig.log .config.old
sflash: $(TARGET).hex
#sflash: $(TARGET).hex
# $(LAUNCH_BOOTLOADER) $(SERIAL) 115200
avrdude -p m32 -b 115200 -u -c avr109 -P $(SERIAL) -U f:w:$< -F
echo X > $(SERIAL)
# avrdude -p m32 -b 115200 -u -c avr109 -P $(SERIAL) -U f:w:$< -F
# echo X > $(SERIAL)
uflash: $(TARGET).hex
avrdude -c usbasp -p atmega32 -V -U f:w:$< -F
#uflash: $(TARGET).hex
# avrdude -c usbasp -p atmega32 -V -U f:w:$< -F
.PHONY: clean mrproper sflash uflash
##############################################################################

View File

@ -45,7 +45,8 @@ ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
LIBS_SIM = -lgdi32 -lwinmm -lm
else
ifeq ($(OSTYPE),FreeBSD)
CFLAGS_SIM = -g -I/usr/local/include -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600
CFLAGS_SIM = -g -I/usr/local/include -Wall -pedantic -std=c99 -O0
CFLAGS_SIM += -D_XOPEN_SOURCE=600
ifeq ($(MACHINE),amd64)
LDFLAGS_SIM = -L/usr/local/lib -T ld_scripts/elf_x86_64_fbsd.x
else
@ -78,12 +79,17 @@ $(TARGET):
##############################################################################
# include user's config.mk file
config.mk:
@echo "# Put your own config here!" > $@
@echo "#F_CPU = $(F_CPU)" >> $@
@echo "#MCU = $(MCU)" >> $@
@echo "created default config.mk, tune your settings there!"
-include config.mk
$(MAKETOPDIR)/config.mk:
@echo "# Customize your config here!" >$@
@echo "# Add further CFLAGS by using the += operator, eg." >>$@
@echo "# CFLAGS += -mstrict-X" >>$@
@echo "#" >>$@
@echo "# In case you wonder: -mstrict-X produces smaller code, but" >>$@
@echo "# is only available on avr-gcc 4.7.0 or higher." >>$@
@echo "#" >>$@
@echo "# Other flags you might want to tune: CPPFLAGS, LDFLAGS ..." >>$@
@echo "Created default config.mk, tune your settings there!"
-include $(MAKETOPDIR)/config.mk
##############################################################################
@ -97,7 +103,7 @@ include $(MAKETOPDIR)/.config
CPPFLAGS += -DF_CPU=$(FREQ)UL -mmcu=$(MCU)
# flags for the linker
# flags for the linker, choose appropriate linker script
ifeq ($(findstring atmega128,$(MCU)),atmega128)
LDFLAGS += -T ld_scripts/avr51.x -Wl,-Map,image.map -mmcu=$(MCU)
else