* as/hc08/Makefile.bcc, as/hc08/Makefile.in, as/hc08/as_hc08.dsp,
[fw/sdcc] / as / hc08 / Makefile.in
1 #
2 #
3 #
4
5 VERSION         = @VERSION@
6 VERSIONHI       = @VERSIONHI@
7 VERSIONLO       = @VERSIONLO@
8 VERSIONP        = @VERSIONP@
9
10 SHELL           = /bin/sh
11 CC              = @CC@
12 CPP             = @CPP@
13 INSTALL         = @INSTALL@
14 STRIP           = @STRIP@
15
16 top_builddir    = @top_builddir@
17 top_srcdir      = @top_srcdir@
18
19 srcdir          = @srcdir@
20 prefix          = @prefix@
21 exec_prefix     = @exec_prefix@
22 bindir          = @bindir@
23 libdir          = @libdir@
24 datadir         = @datadir@
25 datarootdir     = @datarootdir@
26 includedir      = @includedir@
27 mandir          = @mandir@
28 man1dir         = $(mandir)/man1
29 man2dir         = $(mandir)/man2
30 infodir         = @info@
31
32 EXEEXT          = @EXEEXT@
33
34 VPATH           = @srcdir@
35
36 CPPFLAGS        = @CPPFLAGS@ -I. -I$(srcdir)
37 CFLAGS          = @CFLAGS@ -Wall -I. -I$(srcdir)
38 M_OR_MM         = @M_OR_MM@
39 LDFLAGS         = @LDFLAGS@
40
41 OBJDIR = obj
42
43 UTILLIB = $(srcdir)/../../support/Util
44 UTILSRC = dbuf.c dbuf_string.c
45 UTILLIBOBJS = $(UTILSRC:%.c=$(OBJDIR)/%.o)
46
47 ASXXLIB = $(srcdir)/../asxxsrc
48 ASXXLIBSRC = strcmpi.c assym.c aslex.c
49 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
50
51 SRC = asmain.c assubr.c asnoice.c \
52       asexpr.c asdata.c aslist.c asout.c \
53       m08ext.c m08pst.c m08mch.c m08adr.c
54 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
55
56 ASSOURCES = %(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c) $(UTILSRC:%.c=$(UTILLIB)/%.c)
57
58 AASOBJECTS = $(OBJS) $(ASXXLIBOBJS) $(UTILLIBOBJS)
59
60 ASHC08 = $(top_builddir)/bin/as-hc08$(EXEEXT)
61
62 transform       = @program_transform_name@
63
64 # Compiling entire program or any subproject
65 # ------------------------------------------
66 all: checkconf $(ASHC08)
67
68 $(ASHC08): $(ASOBJECTS)
69         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS) 
70
71 # Compiling and installing everything and runing test
72 # ---------------------------------------------------
73 install: all installdirs
74         $(INSTALL) $(ASHC08) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
75         $(STRIP) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
76
77 # Deleting all the installed files
78 # --------------------------------
79 uninstall:
80         rm -f $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)
81
82
83 # Performing self-test
84 # --------------------
85 check:
86
87
88 # Performing installation test
89 # ----------------------------
90 installcheck:
91
92
93 # Creating installation directories
94 # ---------------------------------
95 installdirs:
96         $(INSTALL) -d $(DESTDIR)$(bindir)
97
98
99 # Creating dependencies
100 # ---------------------
101 dep: Makefile.dep
102
103 Makefile.dep: $(ASSOURCES) $(srcdir)/*.h
104         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
105
106 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
107                                    clean distclean mostlyclean realclean)" ""
108   -include Makefile.dep
109 endif
110 include $(srcdir)/clean.mk
111
112 # My rules
113 # --------
114 $(OBJDIR)/.stamp:
115         mkdir -p $(OBJDIR)
116         touch $(OBJDIR)/.stamp
117
118 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
119         $(CC) -c $(CFLAGS) -o $@ $<
120
121 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
122         $(CC) -c $(CFLAGS) -o $@ $<
123
124
125 # Remaking configuration
126 # ----------------------
127 checkconf:
128         @if [ -f $(top_builddir)/devel ]; then\
129           $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
130         fi
131
132 # End of Makefile