6 VERSIONHI
= @VERSIONHI@
7 VERSIONLO
= @VERSIONLO@
17 top_builddir
= @top_builddir@
18 top_srcdir
= @top_srcdir@
22 exec_prefix = @
exec_prefix@
26 datarootdir
= @datarootdir@
27 includedir = @
includedir@
29 man1dir = $(mandir)/man1
30 man2dir = $(mandir)/man2
37 CPPFLAGS
= @CPPFLAGS@
-I..
-I
$(srcdir)/..
38 CFLAGS
= @CFLAGS@ @WALL_FLAG@
-DINDEXLIB
-DUNIX
-I.
-I
$(srcdir)
43 ASXXLIB
= $(srcdir)/..
/asxxsrc
45 ASXXLIBSRC
= strcmpi.c
47 SRC
= lk_readnl.c lkaomf51.c lkar.c lkarea.c lkdata.c lkelf.c lkeval.c \
48 lkhead.c lklex.c lklib.c lklibr.c lklist.c lkmain.c lkmem.c \
49 lknoice.c lkout.c lkrel.c lkrloc.c lkrloc3.c lksdcclib.c \
50 lksym.c sdld.c lksdcdb.c lkbank.c
52 LKSOURCES
= $(SRC
) $(ASXXLIBSRC
:%.c
=$(ASXXLIB
)/%.c
)
54 OBJS
= $(SRC
:%.c
=$(OBJDIR
)/%.o
)
55 ASXXLIBOBJS
= $(ASXXLIBSRC
:%.c
=$(OBJDIR
)/%.o
)
56 LKOBJECTS
= $(OBJS
) $(LKOBJS
) $(ASXXLIBOBJS
)
58 $(LKOBJECTS
) : aslink.h
60 ASLINK
= $(top_builddir
)/bin
/sdld
$(EXEEXT
)
62 transform
= @program_transform_name@
64 # Compiling entire program or any subproject
65 # ------------------------------------------
66 all: sdcc-ld8051 sdcc-ldz80 sdcc-ldgb sdcc-ld6808 sdcc-ldstm8 sdcc-ldpdk sdcc-ldf8
68 sdcc-ld8051
: checkconf
$(ASLINK
)
70 sdcc-ldz80
: checkconf
$(top_builddir
)/bin
/sdldz80
$(EXEEXT
)
72 sdcc-ldgb
: checkconf
$(top_builddir
)/bin
/sdldgb
$(EXEEXT
)
74 sdcc-ld6808
: checkconf
$(top_builddir
)/bin
/sdld6808
$(EXEEXT
)
76 sdcc-ldstm8
: checkconf
$(top_builddir
)/bin
/sdldstm8
$(EXEEXT
)
78 sdcc-ldf8
: checkconf
$(top_builddir
)/bin
/sdldf8
$(EXEEXT
)
80 sdcc-ldpdk
: checkconf
$(top_builddir
)/bin
/sdldpdk
$(EXEEXT
)
82 $(top_builddir
)/bin
/sdldz80
$(EXEEXT
) $(top_builddir
)/bin
/sdldgb
$(EXEEXT
) $(top_builddir
)/bin
/sdldstm8
$(EXEEXT
) $(top_builddir
)/bin
/sdld6808
$(EXEEXT
) $(top_builddir
)/bin
/sdldpdk
$(EXEEXT
) $(top_builddir
)/bin
/sdldf8
$(EXEEXT
): $(ASLINK
)
85 $(ASLINK
): $(LKOBJECTS
)
86 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(LKOBJECTS
)
88 # Compiling and installing everything and running test
89 # ----------------------------------------------------
90 install: all installdirs
91 $(INSTALL
) $(top_builddir
)/bin
/sdld
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT
)
92 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT
)
93 if
[ "`grep stm8 $(top_builddir)/ports.build`" = "stm8" ]; \
95 $(INSTALL
) $(top_builddir
)/bin
/sdldstm8
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT
); \
96 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT
); \
98 if
[ "`grep hc08 $(top_builddir)/ports.build`" = "hc08" ]; \
100 $(INSTALL
) $(top_builddir
)/bin
/sdld6808
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT
); \
101 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT
); \
103 if
[ "`grep z80 $(top_builddir)/ports.build`" = "z80" ]; \
105 $(INSTALL
) $(top_builddir
)/bin
/sdldz80
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT
); \
106 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT
); \
107 $(INSTALL
) $(top_builddir
)/bin
/sdldgb
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT
); \
108 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT
); \
110 if
[ "`grep pdk $(top_builddir)/ports.build`" = "pdk" ]; \
112 $(INSTALL
) $(top_builddir
)/bin
/sdldpdk
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT
); \
113 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT
); \
115 if
[ "`grep f8 $(top_builddir)/ports.build`" = "f8" ]; \
117 $(INSTALL
) $(top_builddir
)/bin
/sdldf8
$(EXEEXT
) $(DESTDIR
)$(bindir)/`echo 'sdldf8' | sed '$(transform)'`$(EXEEXT
); \
118 $(STRIP
) $(DESTDIR
)$(bindir)/`echo 'sdldf8' | sed '$(transform)'`$(EXEEXT
); \
121 # Deleting all the installed files
122 # --------------------------------
124 for
ld in
$(top_builddir
)/bin
/sdld
$(top_builddir
)/bin
/sdldz80
$(top_builddir
)/bin
/sdldgb
$(top_builddir
)/bin
/sdldstm8
$(top_builddir
)/bin
/sdld6808
$(top_builddir
)/bin
/sdldpdk
$(top_builddir
)/bin
/sdldf8
; \
126 rm -f
$(DESTDIR
)$(bindir)/`echo \`basename $$ld\
` | sed '$(transform)'`$(EXEEXT
); \
130 # Performing self-test
131 # --------------------
135 # Performing installation test
136 # ----------------------------
140 # Creating installation directories
141 # ---------------------------------
143 $(INSTALL
) -d
$(DESTDIR
)$(bindir)
146 # Creating dependencies
147 # ---------------------
148 SPECIAL
= $(srcdir)/*.h
149 include $(srcdir)/clean.mk
155 touch
$(OBJDIR
)/.stamp
157 $(OBJDIR
)/%.o
: %.c
$(OBJDIR
)/.stamp
158 $(CC
) -c
$(CFLAGS
) -o
$@
$<
160 $(OBJDIR
)/%.o
: $(ASXXLIB
)/%.c
$(OBJDIR
)/.stamp
161 $(CC
) -c
$(CFLAGS
) -o
$@
$<
164 # Remaking configuration
165 # ----------------------
167 @if
[ -f
$(top_builddir
)/devel
]; then\
168 $(MAKE
) -f ..
/conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" freshconf
;\