* configure.in: added missing mcs51 in status output
[fw/sdcc] / sim / ucsim / main_in.mk
1 #
2 # S51 main.mk
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 top_builddir    = @top_builddir@
17 top_srcdir      = @top_srcdir@
18 SIMDIR          = sim.src
19 CMDDIR          = cmd.src
20 GUIDIR          = gui.src
21
22 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
23 # FIXME: -Imcs51 must be removed!!!
24 CPPFLAGS        = @CPPFLAGS@ -I$(top_builddir) -I$(srcdir) \
25                   -I$(top_srcdir)/$(SIMDIR) \
26                   -I$(top_srcdir)/$(CMDDIR) -I$(top_srcdir)/$(GUIDIR)
27 CFLAGS          = @CFLAGS@ -I$(top_builddir) -Wall
28 CXXFLAGS        = @CXXFLAGS@ -I$(top_builddir) -Wall
29 M_OR_MM         = @M_OR_MM@
30
31 EXEEXT          = @EXEEXT@
32
33 LIB_LIST        = util cmd sim
34 UCSIM_LIBS      = -Wl,--start-group $(patsubst %,-l%,$(LIB_LIST)) -Wl,--end-group
35 UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
36
37 prefix          = @prefix@
38 exec_prefix     = @exec_prefix@
39 bindir          = @bindir@
40 libdir          = @libdir@
41 datadir         = @datadir@
42 datarootdir     = @datarootdir@
43 includedir      = @includedir@
44 mandir          = @mandir@
45 man1dir         = $(mandir)/man1
46 man2dir         = $(mandir)/man2
47 infodir         = @infodir@
48 srcdir          = @srcdir@
49 VPATH           = @srcdir@
50
51 OBJECTS         = pobj.o globals.o utils.o error.o app.o option.o
52 SOURCES         = $(patsubst %.o,%.cc,$(OBJECTS))
53 UCSIM_OBJECTS   = ucsim.o
54 UCSIM_SOURCES   = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
55 ALL_SOURCES     = $(SOURCES) $(UCSIM_SOURCES)
56
57 enable_ucsim    = @enable_ucsim@
58
59
60 # Compiling entire program or any subproject
61 # ------------------------------------------
62 all: checkconf libs
63
64 libs: libutil.a
65
66 main_app: checkconf ucsim_app
67
68 # Compiling and installing everything and runing test
69 # ---------------------------------------------------
70 install: all installdirs
71
72
73 # Deleting all the installed files
74 # --------------------------------
75 uninstall:
76         rm -f $(DESTDIR)$(bindir)/s51$(EXEEXT)
77         rm -f $(DESTDIR)$(bindir)/savr$(EXEEXT)
78         rm -f $(DESTDIR)$(bindir)/serialview$(EXEEXT)
79         rm -f $(DESTDIR)$(bindir)/portmon$(EXEEXT)
80
81
82 # Performing self-test
83 # --------------------
84 check:
85
86 test:
87
88 # Performing installation test
89 # ----------------------------
90 installcheck:
91
92
93 # Creating installation directories
94 # ---------------------------------
95 installdirs:
96
97
98 # Creating dependencies
99 # ---------------------
100 dep: main.dep
101
102 main.dep: $(ALL_SOURCES) *.h $(srcdir)/*.h
103         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >main.dep
104
105 include main.dep
106 include $(srcdir)/clean.mk
107
108 #parser.cc: parser.y
109
110 #plex.cc: plex.l
111
112 # My rules
113 # --------
114 libutil.a: $(OBJECTS)
115         ar -rcu $*.a $(OBJECTS)
116         $(RANLIB) $*.a
117
118
119 ifeq ($(enable_ucsim),yes)
120 ucsim_app: libs ucsim
121 else
122 ucsim_app:
123 endif
124
125 ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
126         echo $(UCSIM_LIB_FILES)
127         $(CXX) $(CXXFLAGS) -o $@ $< -L$(top_builddir) $(UCSIM_LIBS)
128
129 ptt: ptt.o
130         $(CXX) $(CXXFLAGS) -o $@ $< -lpthread
131 .cc.o:
132         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
133
134
135 # Remaking configuration
136 # ----------------------
137 checkconf:
138         @if [ -f devel ]; then\
139           $(top_srcdir)/mkecho $(top_builddir) "MAIN.MK checkconf";\
140           $(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
141         fi
142
143 # End of main_in.mk/main.mk