57cbf209b9b096834e927e8ca41ff9a70bbff6f0
[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
16 PRJDIR          = ..
17
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
23 M_OR_MM         = @M_OR_MM@
24 PICOPT          = @PICOPT@
25 SHAREDLIB       = @SHAREDLIB@
26
27 EXEEXT          = @EXEEXT@
28
29 LIBS            = @LIBS@ -L$(PRJDIR) -lsim -lutil -lsim -lcmd -lguiucsim
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) -s savr$(EXEEXT) $(bindir)
69
70
71 # Deleting all the installed files
72 # --------------------------------
73 uninstall:
74         rm -f $(bindir)/savr$(EXEEXT)
75
76
77 # Performing self-test
78 # --------------------
79 check: $(TEST_OBJ)
80
81 test:
82
83
84 # Performing installation test
85 # ----------------------------
86 installcheck:
87
88
89 # Creating installation directories
90 # ---------------------------------
91 installdirs:
92         test -d $(bindir) || $(INSTALL) -d $(bindir)
93
94
95 # Creating dependencies
96 # ---------------------
97 dep: Makefile.dep
98
99 Makefile.dep: *.cc *.h
100         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
101
102 include Makefile.dep
103 include clean.mk
104
105 #parser.cc: parser.y
106
107 #plex.cc: plex.l
108
109 # My rules
110 # --------
111 .SUFFIXES: .asm .hex
112
113 avr.src: savr$(EXEEXT) shared_lib
114
115 savr$(EXEEXT): $(OBJECTS) $(PRJDIR)/*.a
116         $(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $@
117
118 ifeq ($(dlso_ok),yes)
119 shared_lib: $(PRJDIR)/savr.so
120 else
121 shared_lib:
122         @$(PRJDIR)/mkecho $(PRJDIR) "No AVR shared lib made."
123         @$(PRJDIR)/mkecho $(PRJDIR) "(SHAREDLIB="$(SHAREDLIB)",dl_ok="$(dl_ok)",enable_dlso="$(enable_dlso)")"
124 endif
125
126 $(PRJDIR)/savr.so: $(OBJECTS_SHARED)
127         $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/savr.so
128
129 otherlibs:
130         cd $(PRJDIR)/cmd.src && $(MAKE) all
131         cd $(PRJDIR)/sim.src && $(MAKE) all
132
133 .cc.o:
134         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
135
136 .asm.hex:
137         $(AVRASM) -l $< -o $@ -e $<.lst
138
139
140 # Remaking configuration
141 # ----------------------
142 checkconf:
143         @if [ -f $(PRJDIR)/devel ]; then\
144           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
145         fi
146
147 # End of avr.src/Makefile.in