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@
27 LIBS = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim
32 exec_prefix = @exec_prefix@
36 includedir = @includedir@
38 man1dir = $(mandir)/man1
39 man2dir = $(mandir)/man2
43 OBJECTS_SHARED = glob.o \
44 simavr.o avr.o port.o \
45 inst.o bit_inst.o jump_inst.o move_inst.o logic_inst.o \
48 OBJECTS = $(OBJECTS_SHARED) $(OBJECTS_EXE)
50 enable_dlso = @enable_dlso@
54 TEST_OBJ = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
55 test_arith.hex test_call.hex
58 # Compiling entire program or any subproject
59 # ------------------------------------------
60 all: checkconf otherlibs avr.src
63 # Compiling and installing everything and runing test
64 # ---------------------------------------------------
65 install: all installdirs
66 $(INSTALL) -s savr $(bindir)
69 # Deleting all the installed files
70 # --------------------------------
75 # Performing self-test
76 # --------------------
82 # Performing installation test
83 # ----------------------------
87 # Creating installation directories
88 # ---------------------------------
90 test -d $(bindir) || $(INSTALL) -d $(bindir)
93 # Creating dependencies
94 # ---------------------
97 Makefile.dep: *.cc *.h
98 $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
111 avr.src: savr shared_lib
113 savr: $(OBJECTS) $(PRJDIR)/*.a
114 $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o savr
116 ifeq ($(dlso_ok),yes)
117 shared_lib: $(PRJDIR)/savr.so
120 @echo "No AVR shared lib made."
121 @echo "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
124 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
125 $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
128 cd $(PRJDIR)/cmd.src && $(MAKE) all
129 cd $(PRJDIR)/sim.src && $(MAKE) all
132 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
135 $(AVRASM) -l $< -o $@ -e $<.lst
138 # Remaking configuration
139 # ----------------------
141 @if [ -f $(PRJDIR)/devel ]; then\
142 $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
145 # End of avr.src/Makefile.in