bison's rule makes trouble too
[fw/sdcc] / sim / ucsim / cmd.src / Makefile.in
1 #
2 # ucsim cmd.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 LEX             = @LEX@
17 YACC            = @YACC@
18 BISON_PLUS_PLUS = @BISON_PLUS_PLUS@
19
20 PRJDIR          = ..
21
22 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
23 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) \
24                   -I$(PRJDIR)/sim.src -I$(PRJDIR)/gui.src
25 CFLAGS          = @CFLAGS@ -Wall
26 CXXFLAGS        = @CXXFLAGS@ -Wall
27 M_OR_MM         = @M_OR_MM@
28
29 prefix          = @prefix@
30 exec_prefix     = @exec_prefix@
31 bindir          = @bindir@
32 libdir          = @libdir@
33 datadir         = @datadir@
34 includedir      = @includedir@
35 mandir          = @mandir@
36 man1dir         = $(mandir)/man1
37 man2dir         = $(mandir)/man2
38 infodir         = @infodir@
39 srcdir          = @srcdir@
40
41 OBJECTS         = cmdset.o command.o newcmd.o cmdutil.o syntax.o \
42                   get.o set.o timer.o bp.o info.o show.o cmdgui.o cmdconf.o \
43                   cmduc.o cmdstat.o cmdmem.o \
44                   cmdpars.o cmdlex.o
45
46 DEVEL           = $(shell ( bash -c "test -e $(PRJDIR)/devel && echo yes" ))
47
48 # Compiling entire program or any subproject
49 # ------------------------------------------
50 all: checkconf cmdlib
51
52 cmd.src: all
53
54
55 # Compiling and installing everything and runing test
56 # ---------------------------------------------------
57 install: all installdirs
58
59
60 # Deleting all the installed files
61 # --------------------------------
62 uninstall:
63
64
65 # Performing self-test
66 # --------------------
67 check:
68
69 test:
70
71
72 # Performing installation test
73 # ----------------------------
74 installcheck:
75
76
77 # Creating installation directories
78 # ---------------------------------
79 installdirs:
80
81
82 # Creating dependencies
83 # ---------------------
84 dep: Makefile.dep
85
86 Makefile.dep: *.cc *.h
87         $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
88
89 include Makefile.dep
90 include clean.mk
91
92 cmdpars.cc: cmdpars.y
93
94 ifeq ($(DEVEL),yes)
95   cmdlex.cc: cmdlex.l cmdpars.h
96 endif
97
98 # My rules
99 # --------
100
101 cmdlib: $(PRJDIR)/libcmd.a
102
103 $(PRJDIR)/libcmd.a: $(OBJECTS)
104         ar -rcu $*.a $(OBJECTS)
105         $(RANLIB) $*.a
106
107 .cc.o:
108         $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
109
110 #.y.cc:
111 #       rm -f $*.cc $*.h
112 #       $(YACC) -d $<
113 #       mv y.tab.c $*.cc
114 #       mv y.tab.h $*.h
115
116 ifeq ($(DEVEL),yes)
117 .y.cc:
118         rm -f $*.cc $*.h
119         $(BISON_PLUS_PLUS) -d -o $*.cc $<
120
121 .l.cc:
122         rm -f $*.cc
123         $(LEX) --c++ -o $*.cc $<
124 endif
125
126
127 # Remaking configuration
128 # ----------------------
129 checkconf:
130         @if [ -f $(PRJDIR)/devel ]; then\
131           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
132         fi
133
134 # End of cmd.src/Makefile.in