* sim/ucsim/gui.src/serio.src/Makefile.in, sim/ucsim/s51.src/Makefile.in, sim/ucsim...
[fw/sdcc] / sim / ucsim / avr.src / Makefile.in
1 #
2 # uCsim avr.src/Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1997
5 #
6
7 STARTYEAR       = 1997
8
9 SHELL           = /bin/sh
10 CXX             = @CXX@
11 CPP             = @CPP@
12 CXXCPP          = @CXXCPP@
13 RANLIB          = @RANLIB@
14 INSTALL         = @INSTALL@
15 STRIP           = @STRIP@
16
17 PRJDIR          = ..
18
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
24 M_OR_MM         = @M_OR_MM@
25 PICOPT          = @PICOPT@
26 SHAREDLIB       = @SHAREDLIB@
27 EXEEXT          = @EXEEXT@
28
29 LIBS            = @LIBS@ -L$(PRJDIR) -lsim -lutil -lguiucsim -lcmd -lsim
30 DL              = @DL@
31 dl_ok           = @dl_ok@
32
33 prefix          = @prefix@
34 exec_prefix     = @exec_prefix@
35 bindir          = @bindir@
36 libdir          = @libdir@
37 datadir         = @datadir@
38 includedir      = @includedir@
39 mandir          = @mandir@
40 man1dir         = $(mandir)/man1
41 man2dir         = $(mandir)/man2
42 infodir         = @infodir@
43 srcdir          = @srcdir@
44
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 \
48                   arith_inst.o
49 OBJECTS_EXE     = savr.o
50 OBJECTS         = $(OBJECTS_SHARED) $(OBJECTS_EXE)
51
52 enable_dlso     = @enable_dlso@
53 dlso_ok         = @dlso_ok@
54
55 AVRASM          = tavrasm
56 TEST_OBJ        = test_bit.hex test_dis.hex test_mov.hex test_jmp.hex \
57                   test_arith.hex test_call.hex
58
59
60 # Compiling entire program or any subproject
61 # ------------------------------------------
62 all: checkconf otherlibs avr.src
63
64
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)
70
71
72 # Deleting all the installed files
73 # --------------------------------
74 uninstall:
75         rm -f $(DESTDIR)$(bindir)/savr
76
77
78 # Performing self-test
79 # --------------------
80 check: $(TEST_OBJ)
81
82 test:
83
84
85 # Performing installation test
86 # ----------------------------
87 installcheck:
88
89
90 # Creating installation directories
91 # ---------------------------------
92 installdirs:
93         test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
94
95
96 # Creating dependencies
97 # ---------------------
98 dep: Makefile.dep
99
100 Makefile.dep: *.cc *.h
101         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
102
103 include Makefile.dep
104 include clean.mk
105
106 #parser.cc: parser.y
107
108 #plex.cc: plex.l
109
110 # My rules
111 # --------
112 .SUFFIXES: .asm .hex
113
114 avr.src: savr$(EXEEXT) shared_lib
115
116 savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
117         $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
118
119 ifeq ($(dlso_ok),yes)
120 shared_lib: $(PRJDIR)/savr.so
121 else
122 shared_lib:
123         @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
124         @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
125 endif
126
127 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
128         $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
129
130 otherlibs:
131         cd $(PRJDIR)/cmd.src && $(MAKE) all
132         cd $(PRJDIR)/sim.src && $(MAKE) all
133
134 .cc.o:
135         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
136
137 .asm.hex:
138         $(AVRASM) -l $< -o $@ -e $<.lst
139
140
141 # Remaking configuration
142 # ----------------------
143 checkconf:
144         @if [ -f $(PRJDIR)/devel ]; then\
145           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
146         fi
147
148 # End of avr.src/Makefile.in