08e82b54bc5f909745e7f91f669a6ab190932b6a
[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 -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 SDCC            = sdcc
28 SDCFLAGS        = --debug --stack-after-data --model-small
29 SDCPPFLAGS      = 
30
31 LIBS            = @LIBS@ -L$(PRJDIR) -lsim -lcmd -lguiucsim -lutil
32 DL              = @DL@
33
34 dl_ok           = @dl_ok@
35
36 prefix          = @prefix@
37 exec_prefix     = @exec_prefix@
38 bindir          = @bindir@
39 libdir          = @libdir@
40 datadir         = @datadir@
41 includedir      = @includedir@
42 mandir          = @mandir@
43 man1dir         = $(mandir)/man1
44 man2dir         = $(mandir)/man2
45 infodir         = @infodir@
46 srcdir          = @srcdir@
47
48 OBJECTS_SHARED  = glob.o sim51.o \
49                   inc.o jmp.o mov.o logic.o arith.o bit.o \
50                   timer0.o timer1.o timer2.o serial.o port.o interrupt.o \
51                   uc51.o uc52.o uc51r.o uc89c51r.o uc251.o
52 OBJECTS_EXE     = s51.o 
53 OBJECTS         = $(OBJECTS_SHARED) $(OBJECTS_EXE)
54
55
56 # Compiling entire program or any subproject
57 # ------------------------------------------
58 all: checkconf otherlibs s51.src
59
60 tests: test_ser.ihx
61
62 test_ser.ihx: test_ser.rel
63         $(SDCC) $(SDCFLAGS) $<
64
65
66 # Compiling and installing everything and runing test
67 # ---------------------------------------------------
68 install: all installdirs
69         if test -f s51.exe; then $(INSTALL) -s s51.exe $(bindir);fi
70         if test -f s51; then $(INSTALL) -s s51 $(bindir);fi
71
72
73 # Deleting all the installed files
74 # --------------------------------
75 uninstall:
76         rm -f $(bindir)/s51
77
78
79 # Performing self-test
80 # --------------------
81 check:
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: .rel
112
113 s51.src: s51 shared_lib
114
115 s51: $(OBJECTS) $(PRJDIR)/*.a
116         $(CXX) $(CXXFLAGS) -o s51 $(OBJECTS) $(LIBS)
117
118 ifeq ($(SHAREDLIB),yes)
119 shared_lib: $(PRJDIR)/s51.so
120 else
121 shared_lib:
122         @echo "No shared lib made."
123 endif
124
125 $(PRJDIR)/s51.so: $(OBJECTS_SHARED)
126         $(CXX) -shared $(OBJECTS_SHARED) -o $(PRJDIR)/s51.so
127
128 otherlibs:
129         cd $(PRJDIR)/cmd.src && $(MAKE) all
130         cd $(PRJDIR)/sim.src && $(MAKE) all
131         $(MAKE) -C $(PRJDIR)/gui.src checkconf ucsim_lib
132
133 .cc.o:
134         $(CXX) $(CXXFLAGS) $(PICOPT) $(CPPFLAGS) -c $< -o $@
135
136 .c.rel:
137         $(SDCC) $(SDCFLAGS) $(SDCPPFLAGS) -c $<
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 s51.src/Makefile.in