62dc60af35056f79519fcf8e217ee3fef9d55416
[fw/sdcc] / sim / ucsim / s51.src / Makefile.in
1 #
2 # uCsim s51.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
21 CFLAGS          = @CFLAGS@ -Wall
22 CXXFLAGS        = @CXXFLAGS@ -Wall
23 M_OR_MM         = @M_OR_MM@
24
25 SDCC            = sdcc
26 SDCFLAGS        = --debug --stack-after-data --model-small
27 SDCPPFLAGS      = 
28
29 LIBS            = @LIBS@ -L$(PRJDIR) -lutil -lsim -lcmd
30
31 prefix          = @prefix@
32 exec_prefix     = @exec_prefix@
33 bindir          = @bindir@
34 libdir          = @libdir@
35 datadir         = @datadir@
36 includedir      = @includedir@
37 mandir          = @mandir@
38 man1dir         = $(mandir)/man1
39 man2dir         = $(mandir)/man2
40 infodir         = @infodir@
41 srcdir          = @srcdir@
42
43 OBJECTS         = s51.o glob.o sim51.o cmd51.o \
44                   inc.o jmp.o mov.o logic.o arith.o bit.o \
45                   timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
46                   uc51.o uc52.o uc51r.o uc89c51r.o uc251.o \
47                   cmd.o dump.o go.o cmd_brk.o set.o where.o show.o
48
49
50 # Compiling entire program or any subproject
51 # ------------------------------------------
52 all: checkconf otherlibs s51.src
53
54 tests: test_ser.ihx
55
56 test_ser.ihx: test_ser.rel
57         $(SDCC) $(SDCFLAGS) $<
58
59
60 # Compiling and installing everything and runing test
61 # ---------------------------------------------------
62 install: all installdirs
63         if test -f s51.exe; then $(INSTALL) -s s51.exe $(bindir);fi
64         if test -f s51; then $(INSTALL) -s s51 $(bindir);fi
65
66
67 # Deleting all the installed files
68 # --------------------------------
69 uninstall:
70         rm -f $(bindir)/s51
71
72
73 # Performing self-test
74 # --------------------
75 check:
76
77
78 # Performing installation test
79 # ----------------------------
80 installcheck:
81
82
83 # Creating installation directories
84 # ---------------------------------
85 installdirs:
86         test -d $(bindir) || $(INSTALL) -d $(bindir)
87
88
89 # Creating dependencies
90 # ---------------------
91 dep: Makefile.dep
92
93 Makefile.dep: *.cc *.h
94         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
95
96 include Makefile.dep
97 include clean.mk
98
99 #parser.cc: parser.y
100
101 #plex.cc: plex.l
102
103 # My rules
104 # --------
105 .SUFFIXES: .rel
106
107 s51.src: s51
108
109 s51: $(OBJECTS) $(PRJDIR)/*.a
110         $(CXX) $(CXXFLAGS) -o s51 $(OBJECTS) $(LIBS)
111
112 otherlibs:
113         cd $(PRJDIR)/cmd.src && $(MAKE) all
114         cd $(PRJDIR)/sim.src && $(MAKE) all
115
116 .cc.o:
117         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
118
119 .c.rel:
120         $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
121
122
123 # Remaking configuration
124 # ----------------------
125 checkconf:
126         @if [ -f $(PRJDIR)/devel ]; then\
127           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
128         fi
129
130 # End of s51.src/Makefile.in