66cf01f7e98024bb22265f61f23692589c1566b6
[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 ASXXLIB = $(srcdir)/../asxxsrc
44
45 ASXXLIBSRC = strcmpi.c assym.c
46
47 SRC = asmain.c aslex.c assubr.c asnoice.c \
48       asexpr.c asdata.c aslist.c asout.c \
49       m08ext.c m08pst.c m08mch.c m08adr.c
50
51 ASSOURCES = %(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c)
52                   
53 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
54 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
55 ASOBJECTS = $(OBJS) $(ASXXLIBOBJS)
56
57 ASHC08 = $(top_builddir)/bin/as-hc08$(EXEEXT)
58
59 transform       = @program_transform_name@
60
61 # Compiling entire program or any subproject
62 # ------------------------------------------
63 all: checkconf $(ASHC08)
64
65 $(ASHC08): $(ASOBJECTS)
66         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS) 
67
68 # Compiling and installing everything and runing test
69 # ---------------------------------------------------
70 install: all installdirs
71         $(INSTALL) $(ASHC08) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
72         $(STRIP) `echo $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)|sed '$(transform)'`
73
74 # Deleting all the installed files
75 # --------------------------------
76 uninstall:
77         rm -f $(DESTDIR)$(bindir)/as-hc08$(EXEEXT)
78
79
80 # Performing self-test
81 # --------------------
82 check:
83
84
85 # Performing installation test
86 # ----------------------------
87 installcheck:
88
89
90 # Creating installation directories
91 # ---------------------------------
92 installdirs:
93         $(INSTALL) -d $(DESTDIR)$(bindir)
94
95
96 # Creating dependencies
97 # ---------------------
98 dep: Makefile.dep
99
100 Makefile.dep: $(ASSOURCES) $(srcdir)/*.h
101         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
102
103 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \
104                                    clean distclean mostlyclean realclean)" ""
105   -include Makefile.dep
106 endif
107 include $(srcdir)/clean.mk
108
109 # My rules
110 # --------
111 $(OBJDIR)/.stamp:
112         mkdir -p $(OBJDIR)
113         touch $(OBJDIR)/.stamp
114
115 $(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp
116         $(CC) -c $(CFLAGS) -o $@ $<
117
118 $(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp
119         $(CC) -c $(CFLAGS) -o $@ $<
120
121
122 # Remaking configuration
123 # ----------------------
124 checkconf:
125         @if [ -f $(top_builddir)/devel ]; then\
126           $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
127         fi
128
129 # End of Makefile