need to commit changes again after renaming for some reason. svn broken?

This commit is contained in:
tixiv 2008-12-03 06:10:03 +00:00
parent fe14b29d15
commit bef788a946
7 changed files with 70 additions and 60 deletions

View File

@ -20,6 +20,8 @@ all: compile-$(TARGET)
@${TOPDIR}/scripts/size $(TARGET) @${TOPDIR}/scripts/size $(TARGET)
@echo "===============================" @echo "==============================="
simulator: autoconf.h .config .subdirs
$(MAKE) -f Makefile.simulator
############################################################################## ##############################################################################
# generic fluff # generic fluff
@ -31,10 +33,11 @@ include defaults.mk
# #
.subdirs: autoconf.h .subdirs: autoconf.h
$(RM) -f $@ @ echo "checking in which subdirs to build"
echo "SUBDIRS += borg_hw" >> $@ @ $(RM) -f $@
echo "SUBDIRS += animations" >> $@ @ echo "SUBDIRS += borg_hw" >> $@
(for subdir in `grep -e "^#define .*_SUPPORT" autoconf.h \ @ echo "SUBDIRS += animations" >> $@
@ (for subdir in `grep -e "^#define .*_SUPPORT" autoconf.h \
| sed -e "s/^#define //" -e "s/_SUPPORT.*//" \ | sed -e "s/^#define //" -e "s/_SUPPORT.*//" \
| tr "[A-Z]\\n" "[a-z] " `; do \ | tr "[A-Z]\\n" "[a-z] " `; do \
test -d $$subdir && echo "SUBDIRS += $$subdir" ; \ test -d $$subdir && echo "SUBDIRS += $$subdir" ; \
@ -45,8 +48,8 @@ ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),mrproper) ifneq ($(MAKECMDGOALS),mrproper)
ifneq ($(MAKECMDGOALS),menuconfig) ifneq ($(MAKECMDGOALS),menuconfig)
include $(TOPDIR)/.subdirs -include $(TOPDIR)/.subdirs
include $(TOPDIR)/.config -include $(TOPDIR)/.config
endif # MAKECMDGOALS!=menuconfig endif # MAKECMDGOALS!=menuconfig
endif # MAKECMDGOALS!=mrproper endif # MAKECMDGOALS!=mrproper
@ -57,42 +60,30 @@ endif # no_deps!=t
.PHONY: compile-subdirs .PHONY: compile-subdirs
compile-subdirs: compile-subdirs:
for dir in $(SUBDIRS); do make -C $$dir lib$$dir.a || exit 5; done @ for dir in $(SUBDIRS); do make -C $$dir objects_avr || exit 5; done
.PHONY: compile-$(TARGET) .PHONY: compile-$(TARGET)
compile-$(TARGET): compile-subdirs $(TARGET).hex $(TARGET).bin $(TARGET).lst compile-$(TARGET): compile-subdirs $(TARGET).hex $(TARGET).bin $(TARGET).lst
OBJECTS += $(patsubst %.c,%.o,${SRC}) OBJECTS += $(patsubst %.c,./obj_avr/%.o,${SRC})
LINKLIBS = $(foreach subdir,$(SUBDIRS),$(subdir)/lib$(subdir).a) SUBDIROBJECTS = $(foreach subdir,$(SUBDIRS),$(foreach object,$(shell cat $(subdir)/obj_avr/.objects),$(subdir)/$(object)))
# FIXME how can we omit specifying every file to be linked twice? $(TARGET): $(OBJECTS) $(SUBDIROBJECTS)
# This is currently necessary because of interdependencies between $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBDIROBJECTS)
# the libraries, which aren't denoted in these however.
$(TARGET): $(OBJECTS) $(LINKLIBS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
$(foreach subdir,$(SUBDIRS),-L$(subdir) -l$(subdir)) \
$(foreach subdir,$(SUBDIRS),-l$(subdir)) \
$(foreach subdir,$(SUBDIRS),-l$(subdir))
############################################################################## ##############################################################################
./obj_avr/%.o: %.c
@ if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
@ echo "compiling $<"
@ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
%.hex: % %.hex: %
$(OBJCOPY) -O ihex -R .eeprom $< $@ $(OBJCOPY) -O ihex -R .eeprom $< $@
ifeq ($(HTTPD_INLINE_FILES_SUPPORT),y) %.bin: %
INLINE_FILES := $(wildcard httpd/embed/*)
else
INLINE_FILES :=
endif
%.bin: % $(INLINE_FILES)
$(OBJCOPY) -O binary -R .eeprom $< $@ $(OBJCOPY) -O binary -R .eeprom $< $@
ifeq ($(HTTPD_INLINE_FILES_SUPPORT),y)
$(MAKE) -C httpd httpd-concat
httpd/do-embed $(INLINE_FILES)
$(OBJCOPY) -O ihex -I binary $(TARGET).bin $(TARGET).hex
endif
%.eep.hex: % %.eep.hex: %
$(OBJCOPY) --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex -j .eeprom $< $@ $(OBJCOPY) --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O ihex -j .eeprom $< $@
@ -112,31 +103,23 @@ menuconfig:
$(MAKE) -C scripts/lxdialog all $(MAKE) -C scripts/lxdialog all
$(CONFIG_SHELL) scripts/Menuconfig config.in $(CONFIG_SHELL) scripts/Menuconfig config.in
test -e .config test -e .config
@$(MAKE) no_deps=t what-now-msg
what-now-msg:
@echo "" @echo ""
@echo "Next, you can: " @echo "Next, you can: "
@echo " * 'make' to compile your borgware" @echo " * 'make' to compile your borgware"
@for subdir in $(SUBDIRS); do \
test -e "$$subdir/configure" -a -e "$$subdir/cfgpp" \
&& echo " * 'make $$subdir/menuconfig' to" \
"further configure $$subdir"; done || true
@echo ""
.PHONY: what-now-msg
%/menuconfig:
$(SH) "$(@D)/configure" #%/menuconfig:
@$(MAKE) what-now-msg # $(SH) "$(@D)/configure"
# @$(MAKE) what-now-msg
############################################################################## ##############################################################################
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 .subdirs $(RM) $(TARGET) $(TARGET).bin $(TARGET).hex $(TARGET).lst .subdirs
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 && make no_deps=t -C $$subdir clean ; done ; true
mrproper: mrproper:
$(MAKE) clean $(MAKE) clean

View File

@ -1,5 +1,8 @@
Hier liegt der Versuch, eine universelle Codebasis für 2d-borgs zu bauen, die Hier liegt der Versuch, eine universelle Codebasis für 2d-borgs zu bauen, die
durch 'make menuconfig' konfigurierbar ist. Das ganze ist grade nochnicht durch 'make menuconfig' konfigurierbar ist.
besonders weit, und funktioniert noch garnicht. Work is in progress... Zur Zeit ist es bereits möglich, gewisse Dinge in menuconfig einzustellen.
Einfach mal ansehen! Compiliert werden kann das Ganze auch scon. Es fehlt noch
Support für das Spiele-Auswahlmenü und die Spiele.
Außerdem wird grade versucht, das Ganze mit dem Borg-api-Simulator zu
integrieren.

View File

@ -18,7 +18,6 @@ HOSTCC := gcc
export HOSTCC export HOSTCC
# flags for the compiler # flags for the compiler
CPPFLAGS += -mmcu=$(MCU)
CFLAGS ?= -Wall -W -Wno-unused-parameter -Wno-sign-compare CFLAGS ?= -Wall -W -Wno-unused-parameter -Wno-sign-compare
CFLAGS += -g -Os -std=gnu99 -fgnu89-inline CFLAGS += -g -Os -std=gnu99 -fgnu89-inline

View File

@ -10,7 +10,8 @@ ifneq ($(MAKECMDGOALS),mrproper)
ifneq ($(MAKECMDGOALS),menuconfig) ifneq ($(MAKECMDGOALS),menuconfig)
# For each .o file we need a .d file. # For each .o file we need a .d file.
-include $(subst .o,.d,$(filter %.o,$(OBJECTS))) /dev/null #-include $(subst .o,.d,$(filter %.o,$(OBJECTS))) /dev/null
-include $(subst .o,.d,$(filter %.o,$(OBJECTS)))
endif endif
endif endif
@ -20,13 +21,15 @@ endif
# Here is how to build those dependency files # Here is how to build those dependency files
define make-deps define make-deps
echo "checking dependencies for $<"
if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MM $< | \ set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MM $< | \
sed > $@.new -e 's;$(*F)\.o:;$@ $*.o $*.E $*.s:;' \ sed > $@.new -e 's;$(*F)\.o:;$@ obj_avr/$*.o obj_avr/$*.E $*.s:;' \
-e 's% [^ ]*/gcc-lib/[^ ]*\.h%%g' -e 's% [^ ]*/gcc-lib/[^ ]*\.h%%g'
if test -s $@.new; then mv -f $@.new $@; else rm -f $@.new; fi if test -s $@.new; then mv -f $@.new $@; else rm -f $@.new; fi
endef endef
# Here is how to make .d files from .c files # Here is how to make .d files from .c files
%.d: %.c $(TOPDIR)/pinning.c; $(make-deps) obj_avr/%.d: %.c ; @ $(make-deps)
%.d: %.S ; $(make-deps) obj_avr/%.d: %.S ; @ $(make-deps)

10
random/Makefile Normal file
View File

@ -0,0 +1,10 @@
TARGET = objects_avr
TOPDIR = ..
include $(TOPDIR)/defaults.mk
SRC = prng.c persistentCounter.c
ASRC = noekeon_asm.S memxor.S
include $(TOPDIR)/rules.mk

View File

@ -1,21 +1,33 @@
OBJECTS += $(patsubst %.c,%.o,${SRC}) OBJECTS += $(patsubst %.c,obj_avr/%.o,${SRC})
OBJECTS += $(patsubst %.S,%.o,${ASRC}) OBJECTS += $(patsubst %.S,obj_avr/%.o,${ASRC})
%.a: $(OBJECTS) #./obj_avr/%.a: $(OBJECTS)
$(RM) $@ # $(AR) qcv $@ $^
$(AR) qcv $@ $^
# $(STRIP) --strip-unneeded $@ # $(STRIP) --strip-unneeded $@
%.o: %.S ./obj_avr/%.o: %.S
$(CC) -o $@ $(CPPFLAGS) $(ASFLAGS) -c $< @ if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
@ echo "assembling $<"
@ $(CC) -o $@ $(CPPFLAGS) $(ASFLAGS) -c $<
./obj_avr/%.o: %.c
@ if [ ! -d obj_avr ]; then mkdir obj_avr ; fi
@ echo "compiling $<"
@ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
clean-common: clean-common:
$(RM) $(TARGET) *.[odasE] *.d.new *~ $(RM) $(TARGET) *.[odasE] *.d.new *~
$(RM) -r ./obj_avr
clean: clean-common clean: clean-common
all: all:
make -C $(TOPDIR) all make -C $(TOPDIR) all
objects_avr: $(OBJECTS)
@ echo "writing object ineventory"
@ echo $(OBJECTS) > obj_avr/.objects
include $(TOPDIR)/depend.mk include $(TOPDIR)/depend.mk

View File

@ -1,4 +1,4 @@
TARGET = libscrolltext.a TARGET = objects
TOPDIR = .. TOPDIR = ..
include $(TOPDIR)/defaults.mk include $(TOPDIR)/defaults.mk