sdcc_libdir = $(DESTDIR)$(datadir)/$(lib_dir_suffix)
CPPFLAGS = -I$(INCDIR) -I$(PORTINCDIR)
-CFLAGS = $(MODELFLAGS) --nostdinc --std-sdcc99
+CFLAGS = $(MODELFLAGS) --nostdinc --std-c99
BUILDDIR = build
# Default
_strncpy.c _strpbrk.c _strrchr.c _strspn.c \
_strstr.c _strtok.c \
_memcmp.c _memcpy.c _memmove.c _memset.c \
- _heap.c calloc.c malloc.c realloc.c free.c \
+ _heap.c _calloc.c _malloc.c _realloc.c _free.c \
printf_large.c sprintf.c vprintf.c puts.c gets.c \
printf_fast.c printf_fast_f.c printf_tiny.c printfl.c \
assert.c time.c bpx.c \
_strcspn.c _strlen.c _strncat.c _strncmp.c \
_strncpy.c _strpbrk.c _strrchr.c _strspn.c \
_strstr.c _strtok.c \
- _memcmp.c _memcpy.c _memmove.c _memset.c \
- calloc.c malloc.c realloc.c free.c \
+ _memcmp.c _memcpy.c _memset.c \
+ _calloc.c _malloc.c _realloc.c _free.c \
printf_large.c sprintf.c vprintf.c puts.c gets.c \
assert.c time.c \
fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \
_strncpy.c _strpbrk.c _strrchr.c _strspn.c \
_strstr.c _strtok.c \
_uchar2fs.c _uint2fs.c _ulong2fs.c \
- _heap.c calloc.c malloc.c realloc.c free.c \
+ _heap.c _calloc.c _malloc.c _realloc.c _free.c \
puts.c gets.c \
printf_large.c puts.c gets.c \
assert.c time.c \
_strncpy.c _strpbrk.c _strrchr.c _strspn.c \
_strstr.c _strtok.c \
_memcmp.c _memcpy.c _memmove.c _memset.c \
- _heap.c calloc.c malloc.c realloc.c free.c \
+ _heap.c _calloc.c _malloc.c _realloc.c _free.c \
printf_large.c sprintf.c vprintf.c puts.c gets.c \
assert.c time.c \
fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \
model-pic16:
if [ "`grep pic16 $(top_builddir)/ports.build`" = pic16 ]; then \
- $(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
+ $(MAKE) PORT=pic16 objects-pic16; \
fi
objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
- -cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
-# yes, we do reuse the *-pic16 rules for pic14
model-pic14:
if [ "`grep pic $(top_builddir)/ports.build | grep -v pic16`" = pic ]; then \
- $(MAKE) MODELFLAGS="-mpic14" PORT=pic OEXT=.lib objects-pic16; \
+ $(MAKE) PORT=pic objects-pic14; \
fi
+objects-pic14: build-dir port-specific-objects-pic14 clean_intermediate-pic14
+
build-dir: $(PORTDIR)
$(PORTDIR):
fi
port-specific-objects-pic16:
+ -if [ -f $(PORT)/Makefile ]; then \
+ $(MAKE) -C $(PORT); \
+ for i in $(PORT)/*/lib*.a; do cp -f $$i $(PORTDIR)/$$(basename $$i .a).lib; done; \
+ cp -f $(PORT)/*/crt0*.o $(PORTDIR); \
+ fi
+
+port-specific-objects-pic14:
-if [ -f $(PORT)/Makefile ]; then \
mkdir -p $(PORT)/bin; \
$(MAKE) -C $(PORT); \
clean_intermediate-pic16:
$(MAKE) -C $(PORT) clean-intermediate
+clean_intermediate-pic14:
+ $(MAKE) -C $(PORT) clean-intermediate
+
# Compiling and installing everything and runing test
# ---------------------------------------------------
install: all installdirs
for src in $(MODELS) ds390 ds400 gbz80 z80 hc08 pic pic16; do \
find $(sdcc_libdir)/src/$$src -depth \
\( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
- -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
- -name 'Makefile*' \) \
- -exec rm -rf {}+ \; ; \
+ -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'autom4te.cache' -o \
+ -name 'build' -o -name 'bin' -o -name 'Makefile*' -o -name 'config*' -o \
+ -name 'depcomp' -o -name 'missing' -o -name 'install-sh' -o \
+ -name 'bootstrap.sh' \) \
+ -exec rm -rf {} + ; \
done
find $(sdcc_libdir)/src/mcs51 -depth \
\( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
-name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
-name 'Makefile*' \) \
- -exec rm -rf {}+ \;
+ -exec rm -rf {} +
# Deleting all the installed files
# --------------------------------
ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
clean distclean mostlyclean realclean)" ""
- include Makefile.dep
+ -include Makefile.dep
endif
include $(srcdir)/clean.mk