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@
29 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim
34 exec_prefix = @exec_prefix@
38 includedir = @includedir@
40 man1dir = $(mandir)/man1
41 man2dir = $(mandir)/man2
45 OBJECTS_SHARED = glob.o \
46 simavr.o avr.o port.o \
47 inst.o bit_inst.o jump_inst.o move_inst.o logic_inst.o \
50 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
52 enable_dlso = @enable_dlso@
56 TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
57 test_arith.hex test_call.hex
60 # Compiling entire program or any subproject
61 # ------------------------------------------
62 all: checkconf otherlibs avr.src
65 # Compiling and installing everything and runing test
66 # ---------------------------------------------------
67 install: all installdirs
68 $(INSTALL) -s savr$(EXEEXT) $(bindir)
71 # Deleting all the installed files
72 # --------------------------------
74 rm -f $(bindir)/savr$(EXEEXT)
77 # Performing self-test
78 # --------------------
84 # Performing installation test
85 # ----------------------------
89 # Creating installation directories
90 # ---------------------------------
92 test -d $(bindir) || $(INSTALL) -d $(bindir)
95 # Creating dependencies
96 # ---------------------
99 Makefile.dep: *.cc *.h
100 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
113 avr.src: savr$(EXEEXT) shared_lib
115 savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
116 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
118 ifeq ($(dlso_ok),yes)
119 shared_lib: $(PRJDIR)/savr.so
122 @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
123 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
126 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
127 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
130 cd $(PRJDIR)/cmd.src && $(MAKE) all
131 cd $(PRJDIR)/sim.src && $(MAKE) all
134 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
137 $(AVRASM) -l $< -o $@ -e $<.lst
140 # Remaking configuration
141 # ----------------------
143 @if [ -f $(PRJDIR)/devel ]; then\
144 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
147 # End of avr.src/Makefile.in