2 # uCsim avr.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
18 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
19 CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \
20 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
21 CFLAGS = @CFLAGS@ -Wall
22 CXXFLAGS = @CXXFLAGS@ -Wall
25 SHAREDLIB = @SHAREDLIB@
28 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
33 exec_prefix = @exec_prefix@
37 includedir = @includedir@
39 man1dir = $(mandir)/man1
40 man2dir = $(mandir)/man2
44 OBJECTS_SHARED = glob.o \
45 simavr.o avr.o port.o \
46 inst.o bit_inst.o jump_inst.o move_inst.o logic_inst.o \
49 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
51 enable_dlso = @enable_dlso@
55 TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
56 test_arith.hex test_call.hex
59 # Compiling entire program or any subproject
60 # ------------------------------------------
61 all: checkconf otherlibs avr.src
64 # Compiling and installing everything and runing test
65 # ---------------------------------------------------
66 install: all installdirs
67 $(INSTALL) -s savr$(EXEEXT) $(DESTDIR)$(bindir)
70 # Deleting all the installed files
71 # --------------------------------
73 rm -f $(DESTDIR)$(bindir)/savr
76 # Performing self-test
77 # --------------------
83 # Performing installation test
84 # ----------------------------
88 # Creating installation directories
89 # ---------------------------------
91 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
94 # Creating dependencies
95 # ---------------------
98 Makefile.dep: *.cc *.h
99 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
112 avr.src: savr$(EXEEXT) shared_lib
114 savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
115 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
117 ifeq ($(dlso_ok),yes)
118 shared_lib: $(PRJDIR)/savr.so
121 @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
122 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
125 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
126 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
129 cd $(PRJDIR)/cmd.src && $(MAKE) all
130 cd $(PRJDIR)/sim.src && $(MAKE) all
133 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
136 $(AVRASM) -l $< -o $@ -e $<.lst
139 # Remaking configuration
140 # ----------------------
142 @if [ -f $(PRJDIR)/devel ]; then\
143 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
146 # End of avr.src/Makefile.in