On Tue, 11 Sep 2007, Klaus Rudolph wrote:
> A first idea from my side: autotools are complex  and sometimes not
> simple to understand. For appending code and understand
> how the build must be done I use my handcrafted Makefile with a very
> simple structure. Maybe it is easier to read :-) for a first understanding
> which files depends on what.

Thanks, albeit a bit late.
So far I've managed to produce simulavr and simulavr.so .
Attached are the remains of your make files.

Any suggestions for running the examples?


Autotools are a bit like plutonium.
One can do good things with them.
One can do very bad things with them.
One can wish for something better.

-- 
Michael   [EMAIL PROTECTED]
"There was a boy called Eustace Clarence Scrubb,
and he almost deserved it."                   --    C. S. Lewis
#include the global configuration file
include ../config.mk
# attention: if -DPROF is also defined here the simulation breaks
# after 1000000 steps!!!! Dont wonder about that again :-)
#PROF=-pg
#PROF=-pg -DPROF
#PROF=
#CXX=/opt/linux/bin/g++
#CC=/opt/linux/bin/gcc

#CFLAGS= -g -Wall $(PROF) -O3 -funroll-loops -fstrict-aliasing 
-fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 
-falign-jumps-max-skip=15 -falign-loops-max-skip=15 -fomit-frame-pointer 
-foptimize-sibling-calls -finline-all-stringops -funit-at-a-time 
-funswitch-loops -ffast-math -march=i686 -mtune=pentium3 -I$(BFD)/bfd
CFLAGS= -g -Wall $(PROF) -O2 -mtune=pentium4 -I$(BFD_H_DIR) -I./..
#CFLAGS= -g -Wall $(PROF) -O2 -mcpu=pentium4 -I$(BFD)/bfd
CXXFLAGS = $(CFLAGS) 


OBJECTS= serialtx.o serialrx.o main.o decoder.o decoder_trace.o gdbserver.o 
avrmalloc.o avrerror.o rwmem.o hardware.o hwstack.o hweeprom.o avrdevice.o 
irqsystem.o hwtimer.o ui.o hwwado.o hwuart.o hwspi.o hwextirq.o hwtimer01irq.o 
hwsreg.o flash.o atmega128.o at8515.o hwmegatimer.o hwmegatimer0123irq.o 
helper.o systemclock.o lcd.o keyboard.o trace.o hwmegaextirq.o mysocket.o 
memory.o at4433.o hwacomp.o pin.o net.o hwport.o pinatport.o ioregs.o hwad.o 
scope.o printable.o application.o

TCL_OBJECTS= serialtx.o serialrx.o main.o decoder.o decoder_trace.o gdbserver.o 
avrmalloc.o avrerror.o rwmem.o hardware.o hwstack.o hweeprom.o avrdevice.o 
irqsystem.o hwtimer.o ui.o hwwado.o hwuart.o hwspi.o hwextirq.o hwtimer01irq.o 
hwsreg.o flash.o atmega128.o at8515.o hwmegatimer.o hwmegatimer0123irq.o 
helper.o systemclock.o simulavr_wrap.o lcd.o keyboard.o trace.o hwmegaextirq.o 
mysocket.o memory.o at4433.o hwacomp.o pin.o net.o hwport.o pinatport.o 
ioregs.o hwad.o scope.o printable.o application.o

TCL_OBJECTS=$(OBJECTS) simulavr_wrap.o

TCLHEADER= serialtx.h serialrx.h avrdevice.h at8515.h atmega128.h at4433.h 
systemclock.h ui.h hardware.h pin.h net.h trace.h gdb.h lcd.h 




simulavr: $(OBJECTS) 
        $(CXX) $(CFLAGS) $(OBJECTS)  $(BFD_LIB_DIR)/libbfd.a 
$(IBERTY_LIB_DIR)/libiberty.a -lncurses -lc -lm -o  simulavr 

# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)



# compile and generate dependency info;
# will also become command-less, prereq-less targets
#   sed:    strip the target (everything before colon)
#   sed:    remove any continuation backslashes
#   fmt -1: list words one per line
#   sed:    strip leading spaces
#   sed:    add trailing colons


%.o: %.c
        $(CC) -c $(CFLAGS) $*.c -o $*.o
        $(CC) -MM $(CFLAGS) $*.c > $*.d
        @mv -f $*.d $*.d.tmp
        @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
        @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
        sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
        @rm -f $*.d.tmp
        

%.o: %.cpp
        $(CXX) -c $(CXXFLAGS) $*.cpp -o $*.o
        $(CXX) -MM $(CXXFLAGS) $*.cpp > $*.d
        @mv -f $*.d $*.d.tmp
        @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
        @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
        sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
        @rm -f $*.d.tmp

#special targets for ui-keyboard 
keytrans.h: keynumber_to_scancode.dat xcode_to_keynumber.dat kbdgentables
        chmod +x kbdgentables
        ./kbdgentables

kbdgentables: kbdgentables.cpp
        $(CXX) $(CXXFLAGS) kbdgentables.cpp -o kbdgentables 

keyboard.o: keytrans.h




clean:
        rm -f *.o simulavr simulavr.so *.bin *.srec *.oo *.om *binm *wrap.c 
*wrap.cxx *.so tags *.o.go *_out dump *.d
        rm -f keytrans.h kbdgentables 
        rm -f gmon.out
        rm -f *.gch
        rm -f *.Plo
        rm -rf .deps
        rm -rf .libs
        

simulavr_wrap.cxx: simulavr.i $(TCLHEADER)
        swig -c++ simulavr.i

simulavr_wrap.o: simulavr_wrap.cxx
        $(CXX) $(CXXFLAGS) simulavr_wrap.cxx -c

simulavr.so: $(TCL_OBJECTS)
        $(CXX) $(CXXFLAGS) $(TCL_OBJECTS) -ltcl$(TCL_VERSION) 
$(BFD_LIB_DIR)/libbfd.a $(IBERTY_LIB_DIR)/libiberty.a -lc -lm -lncurses -shared 
-o simulavr.so


AVR_TOP=/usr/local/avr
IBERTY_LIB_DIR=$(AVR_TOP)/lib
BFD_TOP=$(AVR_TOP)/i686-pc-linux-gnu/avr
BFD_H_DIR=$(BFD_TOP)/include
BFD_LIB_DIR=$(BFD_TOP)/lib

all: simulavr simulavr.so

CXX= g++

#some systems have no libtcl.so,
# they use libtcl8.4 instead so please set TCL_VERSION
#it is allowed to leave TCL_VERSION
TCL_VERSION=8.4 
#TCL_VERSION=

#BFD= /home/user/rudolphk/avrdownload/binutils-2.14

_______________________________________________
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/simulavr-devel

Reply via email to