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

View File

@ -45,7 +45,8 @@ ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
LIBS_SIM = -lgdi32 -lwinmm -lm LIBS_SIM = -lgdi32 -lwinmm -lm
else else
ifeq ($(OSTYPE),FreeBSD) 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) ifeq ($(MACHINE),amd64)
LDFLAGS_SIM = -L/usr/local/lib -T ld_scripts/elf_x86_64_fbsd.x LDFLAGS_SIM = -L/usr/local/lib -T ld_scripts/elf_x86_64_fbsd.x
else else
@ -78,12 +79,17 @@ $(TARGET):
############################################################################## ##############################################################################
# include user's config.mk file # include user's config.mk file
config.mk: $(MAKETOPDIR)/config.mk:
@echo "# Put your own config here!" > $@ @echo "# Customize your config here!" >$@
@echo "#F_CPU = $(F_CPU)" >> $@ @echo "# Add further CFLAGS by using the += operator, eg." >>$@
@echo "#MCU = $(MCU)" >> $@ @echo "# CFLAGS += -mstrict-X" >>$@
@echo "created default config.mk, tune your settings there!" @echo "#" >>$@
-include config.mk @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) CPPFLAGS += -DF_CPU=$(FREQ)UL -mmcu=$(MCU)
# flags for the linker # flags for the linker, choose appropriate linker script
ifeq ($(findstring atmega128,$(MCU)),atmega128) ifeq ($(findstring atmega128,$(MCU)),atmega128)
LDFLAGS += -T ld_scripts/avr51.x -Wl,-Map,image.map -mmcu=$(MCU) LDFLAGS += -T ld_scripts/avr51.x -Wl,-Map,image.map -mmcu=$(MCU)
else else