2 # uCsim avr.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
17 top_builddir = @top_builddir@
18 top_srcdir = @top_srcdir@
20 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
21 CPPFLAGS = @CPPFLAGS@ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) \
22 -I$(top_srcdir)/cmd.src -I$(top_srcdir)/sim.src \
23 -I$(top_srcdir)/gui.src
24 CFLAGS = @CFLAGS@ -Wall
25 CXXFLAGS = @CXXFLAGS@ -Wall
28 SHAREDLIB = @SHAREDLIB@
31 LIBS = -L$(top_builddir) -lsim -lutil -lguiucsim -lcmd -lsim @LIBS@
36 exec_prefix = @exec_prefix@
40 datarootdir = @datarootdir@
41 includedir = @includedir@
43 man1dir = $(mandir)/man1
44 man2dir = $(mandir)/man2
49 OBJECTS_SHARED = glob.o \
50 simavr.o avr.o port.o \
51 inst.o bit_inst.o jump_inst.o move_inst.o logic_inst.o \
54 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
56 enable_dlso = @enable_dlso@
60 TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
61 test_arith.hex test_call.hex
64 # Compiling entire program or any subproject
65 # ------------------------------------------
66 all: checkconf otherlibs avr.src
69 # Compiling and installing everything and runing test
70 # ---------------------------------------------------
71 install: all installdirs
72 $(INSTALL) savr$(EXEEXT) $(DESTDIR)$(bindir)/savr$(EXEEXT)
73 $(STRIP) $(DESTDIR)$(bindir)/savr$(EXEEXT)
76 # Deleting all the installed files
77 # --------------------------------
79 rm -f $(DESTDIR)$(bindir)/savr
82 # Performing self-test
83 # --------------------
89 # Performing installation test
90 # ----------------------------
94 # Creating installation directories
95 # ---------------------------------
97 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
100 # Creating dependencies
101 # ---------------------
104 Makefile.dep: $(srcdir)/*.cc $(srcdir)/*.h
105 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
108 include $(srcdir)/clean.mk
118 avr.src: savr$(EXEEXT) shared_lib
120 savr$(EXEEXT): $(OBJECTS) $(top_builddir)/*.a
121 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
123 ifeq ($(dlso_ok),yes)
124 shared_lib: $(top_builddir)/savr.so
127 @$(top_srcdir)/mkecho $(top_builddir) "No AVR shared lib made."
128 @$(top_srcdir)/mkecho $(top_builddir) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
131 $(top_builddir)/savr.so: $(OBJECTS_SHARED)
132 $(CXX) -shared $(OBJECTS_SHARED) -o $(top_builddir)/savr.so
135 $(MAKE) -C $(top_builddir)/cmd.src all
136 $(MAKE) -C $(top_builddir)/sim.src all
139 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
142 $(AVRASM) -l $< -o $@ -e $<.lst
145 # Remaking configuration
146 # ----------------------
148 @if [ -f $(top_builddir)/devel ]; then\
149 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
152 # End of avr.src/Makefile.in