version 0.5.2
[fw/sdcc] / sim / ucsim / sim.src / Makefile.in
1 #
2 # S51 sim.src/Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1997,99
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)/gui.src
21 CFLAGS          = @CFLAGS@ -Wall
22 CXXFLAGS        = @CXXFLAGS@ -Wall
23 M_OR_MM         = @M_OR_MM@
24
25 prefix          = @prefix@
26 exec_prefix     = @exec_prefix@
27 bindir          = @bindir@
28 libdir          = @libdir@
29 datadir         = @datadir@
30 includedir      = @includedir@
31 mandir          = @mandir@
32 man1dir         = $(mandir)/man1
33 man2dir         = $(mandir)/man2
34 infodir         = @infodir@
35 srcdir          = @srcdir@
36
37 OBJECTS         = stack.o mem.o sim.o itsrc.o brk.o arg.o \
38                   guiobj.o uc.o hw.o
39
40
41 # Compiling entire program or any subproject
42 # ------------------------------------------
43 all: checkconf sim_lib
44
45 test_mem_speed: $(PRJDIR)/lib*.a test_mem_speed.o
46         $(CXX) -o $@ test_mem_speed.o -L$(PRJDIR) -Wl,--start-group -lsim -lutil -lcmd -Wl,--end-group
47
48 sim.src: all
49
50
51 # Compiling and installing everything and runing test
52 # ---------------------------------------------------
53 install: all installdirs
54
55
56 # Deleting all the installed files
57 # --------------------------------
58 uninstall:
59
60
61 # Performing self-test
62 # --------------------
63 check: test
64         ./test_mem_speed
65
66 test: test_mem_speed
67
68 # Performing installation test
69 # ----------------------------
70 installcheck:
71
72
73 # Creating installation directories
74 # ---------------------------------
75 installdirs:
76
77
78 # Creating dependencies
79 # ---------------------
80 dep: main.dep
81
82 Makefile.dep: *.cc *.h
83         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
84
85 include Makefile.dep
86 include clean.mk
87
88 #parser.cc: parser.y
89
90 #plex.cc: plex.l
91
92 # My rules
93 # --------
94
95 sim_lib: $(PRJDIR)/libsim.a
96
97 $(PRJDIR)/libsim.a: $(OBJECTS)
98         ar -rcu $*.a $(OBJECTS)
99         $(RANLIB) $*.a
100
101 .cc.o:
102         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
103
104 .y.cc:
105         rm -f $*.cc $*.h
106         $(YACC) -d $<
107         mv y.tab.c $*.cc
108         mv y.tab.h $*.h
109
110 .l.cc:
111         rm -f $*.cc
112         $(LEX) -t $< >$*.cc
113
114
115 # Remaking configuration
116 # ----------------------
117 checkconf:
118         @if [ -f $(PRJDIR)/devel ]; then\
119           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
120         fi
121
122 # End of sim.src/Makefile