2 # uCsim avr.src/Makefile
4 # (c) Drotos Daniel, Talker Bt. 1997
19 DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
20 CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) \
21 -I$(PRJDIR)/cmd.src -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
22 CFLAGS = @CFLAGS@ -Wall
23 CXXFLAGS = @CXXFLAGS@ -Wall
26 SHAREDLIB = @SHAREDLIB@
29 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
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) savr$(EXEEXT) $(DESTDIR)$(bindir)/savr$(EXEEXT)
69 $(STRIP) $(DESTDIR)$(bindir)/savr$(EXEEXT)
72 # Deleting all the installed files
73 # --------------------------------
75 rm -f $(DESTDIR)$(bindir)/savr
78 # Performing self-test
79 # --------------------
85 # Performing installation test
86 # ----------------------------
90 # Creating installation directories
91 # ---------------------------------
93 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
96 # Creating dependencies
97 # ---------------------
100 Makefile.dep: *.cc *.h
101 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
114 avr.src: savr$(EXEEXT) shared_lib
116 savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
117 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
119 ifeq ($(dlso_ok),yes)
120 shared_lib: $(PRJDIR)/savr.so
123 @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
124 @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
127 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
128 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
131 cd $(PRJDIR)/cmd.src && $(MAKE) all
132 cd $(PRJDIR)/sim.src && $(MAKE) all
135 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
138 $(AVRASM) -l $< -o $@ -e $<.lst
141 # Remaking configuration
142 # ----------------------
144 @if [ -f $(PRJDIR)/devel ]; then\
145 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
148 # End of avr.src/Makefile.in