+2005-08-10 Raphael Neider <rneider AT web.de>
+
+ * src/*.c, src/pic16/{gen.c,glue.c,main.c}: applied Vangelis
+ Rokas' patch to add the new fixed point type "__fixed16x16"
+ * device/lib/pic16/libsdcc/fixed16x16: added Vangelis' support
+ functions for __fixed16x16 arithmetics
+ * device/lib/pic16: reimplemented the build system to support
+ a separate build directory, better handling of libio (create
+ the library in a separate subdir for each architecture) and
+ easier configuration (centralized in Makefile.common)
+
2005-08-07 Raphael Neider <rneider AT web.de>
* src/pic16/gen.c (genrshTwo): fixed sign extension
model-pic16:
if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
$(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
- fi
+ fi
objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
if [ -d $(PORT) ]; then \
mkdir -p $(PORT)/bin; \
$(MAKE) -C $(PORT); \
- cp -f $(PORT)/bin/*.* $(PORTDIR); \
+ cp -f $(PORT)/bin/* $(PORTDIR); \
fi
lib-files:
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
-#
-# Makefile - toplevel makefile that builds everything
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+topsrcdir = .
-include ./Makefile.common
+include $(topsrcdir)/Makefile.common
+SUBDIRS = debug libc libdev libio libm libsdcc startup
+builddir = build
+installdir = bin
+export installdir
-DIRS = startup \
- libdev \
- libsdcc \
- libc \
- libm \
- debug
-
-# libio
+C_SRC = $(wildcard *.c)
+S_SRC = $(wildcard *.S)
+OBJS = $(C_SRC:.c=.o) $(S_SRC:.S=.o)
+.PHONY : all clean clean-intermediate recurse
-all: build-all-libraries
+all : install
-build-all-libraries:
- @for temp in $(DIRS) ; do \
- $(MAKE) -C $$temp MODELFLAGS=$(MODELFLAGS) ; \
- done
+install : builddir recurse
+clean : recurse
+ $(Q)-$(RMDIR) "$(topsrcdir)/$(builddir)";
-lib-io:
- $(MAKE) -C libio MODELFLAGS=$(MODELFLAGS)
+clean-intermediate : recurse
-clean: all-clean
- $(RM) -f bin/*.*
-
-
-
-all-clean:
- @for temp in $(DIRS) ; do \
- $(MAKE) -C $$temp clean ; \
- done
-
-clean-intermediate:
- @for temp in $(DIRS) ; do \
- $(MAKE) -C $$temp clean-intermediate ; \
- done
-
-
-dep: all-dep
-
-all-dep:
- for temp in $(DIRS) ; do \
- $(MAKE) -C $$temp dep ; \
- done
+include $(topsrcdir)/Makefile.rules
-#
-# Makefile.common - common variables makefile
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-CC = $(PRJDIR)/bin/sdcc
-CPP = $(PRJDIR)/bin/sdcpp
+###########################################################
+### Makefile.common.in for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
-AS = @GPASM@
-LD = @GPLINK@
-AR = @GPLIB@
+#################################################
+### verboseness
+#Q ?= # be verbose
+Q ?= @ # be quiet
+# be really quiet (suppress "Entering/Leaving directory...")
+MAKEFLAGS := $(filter-out -s,$(MAKEFLAGS)) -s
+
+#################################################
+### compiler switches
+ARCH ?= 452 # might be overwritten in libio
+
+CFLAGS ?=
+CFLAGS += -mpic16 -p18f$(ARCH)
+CFLAGS += --std-c99
+CFLAGS += -I. -I$(topsrcdir)/../../include/pic16
+
+#################################################
+### optimization flags
+CFLAGS += --fommit-frame-pointer
+CFLAGS += --obanksel=9
+CFLAGS += --denable-peeps
+CFLAGS += --optimize-goto
+CFLAGS += --optimize-cmp
+CFLAGS += --optimize-df
+
+#################################################
+### debugging PIC16 port
+#CFLAGS += --debug-ralloc
+#CFLAGS += --debug-xtra
+#CFLAGS += --pcode-verbose
+CFLAGS += --i-code-in-asm
-RM = @RM@
-CP = @CP@
-MV = @MV@
-LS = @LS@
-SED = @SED@
+#################################################
+### debugging SDCC's optimizations
+#CFLAGS += --nooverlay
+#CFLAGS += --nogcse
+#CFLAGS += --nolabelopt
+#CFLAGS += --noinvariant
+#CFLAGS += --noinduction
+#CFLAGS += --nojtbound
+#CFLAGS += --noloopreverse
-# Quick+dirty fix: this should be defined elsewhere,
-# but it's needed for `make clean`; Bernhard
-MM = -MM
+#################################################
+### assembler switches
+ASFLAGS ?=
+ASFLAGS += -pp18f$(ARCH)
+ASFLAGS += -I$(topsrcdir)/../../include/pic16
+
+#################################################
+### linker switches
+LDFLAGS ?=
+LDFLAGS += -m -l -w
+
+#################################################
+### librarian switches
+LIBFLAGS ?=
+LIBFLAGS += -c
+
+#################################################
+### programs to use
+CPP = $(topsrcdir)/../../../bin/sdcpp
+CC = $(topsrcdir)/../../../bin/sdcc
+AS = @GPASM@
+LD = @GPLINK@
+LIB = @GPLIB@
-CSTD = --std-c99
+SED ?= @SED@
+GREP ?= @EGREP@
-MODELFLAGS = -mpic16
+MKDIR ?= @MKDIR@
+RMDIR ?= @RMDIR@
+CP ?= @CP@
+MV ?= @MV@
+RM ?= @RM@
-OPT_FLAGS += --denable-peeps
-OPT_FLAGS += --obanksel=9
-OPT_FLAGS += --optimize-goto
-OPT_FLAGS += --optimize-df
-OPT_FLAGS += --i-code-in-asm
--- /dev/null
+###########################################################
+### Makefile.rules for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+# update dependencies
+$(topsrcdir)/$(builddir)/%.d : %.c
+ @echo "[ CPP ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+ $(Q)$(CPP) $CPPFLAGS) -o "$@" "$<";
+
+# assemble
+$(topsrcdir)/$(builddir)/%.o : %.S
+ @echo "[ AS ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+ $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$<";
+
+# compile
+$(topsrcdir)/$(builddir)/%.o : %.c
+ @echo "[ CC ] ==> $(patsubst $(topsrcdir)/%,%,$@)";
+ $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<";
+
+# create library
+ifneq (,$(strip $(LIB_O)))
+%.lib : $(LIB_O)
+ @echo "[ LIB ] $(patsubst $(topsrcdir)/%,%,$@) <== $(patsubst $(topsrcdir)/$(builddir)/%,%,$^)";
+ $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^;
+else
+%.lib : force
+ @echo "[ LIB ] $(patsubst $(topsrcdir)/%,%,$@) <== **/*.o";
+ $(Q)$(RM) "$@"; LIB_O=`find "$(topsrcdir)/$(builddir)" -name "*.o"`; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O};
+endif
+
+.PHONY : builddir recurse force
+
+# create builddir
+builddir : force
+ $(Q)[ -d "$(topsrcdir)/$(builddir)" ] || $(MKDIR) "$(topsrcdir)/$(builddir)";
+
+# build sub-directories
+recurse : force
+ $(Q)for DIR in $(SUBDIRS) . ; do \
+ [ "$${DIR}" = "." ] || $(GREP) "^$${ARCH}$$" "$${DIR}.ignore" &> /dev/null || $(MAKE) -C "$${DIR}" builddir="$(builddir)/$${DIR}" $(MAKECMDGOALS) || exit 1; \
+ done
+
+# target to force remaking of (seemingly) independent targets
+force :
--- /dev/null
+###########################################################
+### Makefile.subdir for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+include $(topsrcdir)/Makefile.common
+
+SUBDIRS ?=
+MKLIB ?=
+
+# fallback: if builddir is not specified via the command line...
+builddir ?= build/$(patsubst $(shell cd $(topsrcdir); pwd)/%,%,$(CURDIR))
+
+C_SRC ?= $(wildcard *.c)
+S_SRC ?= $(wildcard *.S)
+OBJS ?= $(addprefix $(topsrcdir)/$(builddir)/,$(C_SRC:.c=.o) $(S_SRC:.S=.o))
+LIB_O ?= $(OBJS)
+
+ifneq (,$(strip $(MKLIB)))
+LIB_LIB = $(topsrcdir)/$(builddir)/$(MKLIB)
+TARGETS ?= $(LIB_LIB)
+else
+LIB_LIB =
+#TARGETS ?= $(OBJS)
+endif
+
+all : install
+
+ifneq (,$(strip $(TARGETS)))
+# usually install $(LIB_LIB) or $(OBJS)
+install : builddir recurse $(OBJS) $(LIB_LIB)
+ @[ -d "$(topsrcdir)/$(installdir)" ] || $(MKDIR) "$(topsrcdir)/$(installdir)";
+ @echo "[INSTALL] $(patsubst $(topsrcdir)/$(builddir)/%,%,$(TARGETS))";
+ $(Q)$(CP) $(TARGETS) "$(topsrcdir)/$(installdir)"
+else
+# used in subdirs like libc/ctype whose files
+# are contained in a parent's library
+install : builddir recurse $(OBJS) $(LIB_LIB)
+endif
+
+clean : recurse
+ @-echo "dummy" > .dummy
+ $(Q)-$(RM) .dummy $(foreach suf,asm d p lst hex cod sym hex,$(OBJS:.o=.$(suf)))
+ @-echo "dummy" > .dummy
+ $(Q)-$(RM) .dummy $(OBJS) $(LIB_LIB)
+ $(Q)-[ ! -d "$(topsrcdir)/$(builddir)" ] || $(RMDIR) "$(topsrcdir)/$(builddir)"
+
+clean-intermediate : recurse
+ @-echo "dummy" > .dummy
+ $(Q)-$(RM) .dummy $(foreach suf,asm d p lst hex cod sym hex,$(OBJS:.o=.$(suf)))
+
+include $(topsrcdir)/Makefile.rules
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
PACKAGE_STRING=
PACKAGE_BUGREPORT=
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GPASM GPLINK GPLIB RM CP MV LS SED LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GPASM GPLINK GPLIB RM CP MV LS SED EGREP MKDIR RMDIR SET_MAKE LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
if $ac_init_version; then
cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
# Get rid of the leading space.
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
*ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
;;
*)
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
}
for ac_var in $ac_subst_files
do
eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
-#AC_DEFUN(AC_CONFIG_SRCDIR)
+
#AC_DEFUN(AC_CONFIG_FILES)
# Checks for programs.
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RM="rm"
+ ac_cv_prog_RM="rm -f"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
echo "${ECHO_T}no" >&6
fi
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+# Extract the first word of "mkdir", so it can be a program name with args.
+set dummy mkdir; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MKDIR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$MKDIR"; then
+ ac_cv_prog_MKDIR="$MKDIR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MKDIR="mkdir -p"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_MKDIR" && ac_cv_prog_MKDIR=":"
+fi
+fi
+MKDIR=$ac_cv_prog_MKDIR
+if test -n "$MKDIR"; then
+ echo "$as_me:$LINENO: result: $MKDIR" >&5
+echo "${ECHO_T}$MKDIR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "rmdir", so it can be a program name with args.
+set dummy rmdir; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RMDIR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RMDIR"; then
+ ac_cv_prog_RMDIR="$RMDIR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RMDIR="rmdir"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_RMDIR" && ac_cv_prog_RMDIR=":"
+fi
+fi
+RMDIR=$ac_cv_prog_RMDIR
+if test -n "$RMDIR"; then
+ echo "$as_me:$LINENO: result: $RMDIR" >&5
+echo "${ECHO_T}$RMDIR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
# Checks for libraries.
# Checks for library functions.
-cp pics.all pics.build
+$CP pics.all pics.build
ac_config_files="$ac_config_files Makefile.common"
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
} |
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
+s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
-s/^[^=]*=[ ]*$//;
+s/^[^=]*=[ ]*$//;
}'
fi
cat >confdef2opt.sed <<\_ACEOF
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
t quote
d
: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
s,\[,\\&,g
s,\],\\&,g
s,\$,$$,g
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
# 2. Add them.
ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
Configuration files:
$config_files
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
s,@MV@,$MV,;t t
s,@LS@,$LS,;t t
s,@SED@,$SED,;t t
+s,@EGREP@,$EGREP,;t t
+s,@MKDIR@,$MKDIR,;t t
+s,@RMDIR@,$RMDIR,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
_ACEOF
AC_PREREQ(2.57)
AC_INIT
-#AC_DEFUN(AC_CONFIG_SRCDIR)
+AC_DEFUN(AC_CONFIG_SRCDIR)
#AC_DEFUN(AC_CONFIG_FILES)
# Checks for programs.
AC_CHECK_PROG(GPLINK, gplink, gplink, :)
AC_CHECK_PROG(GPLIB, gplib, gplib, :)
-AC_CHECK_PROG(RM, rm, rm, :)
+AC_CHECK_PROG(RM, rm, [rm -f], :)
AC_CHECK_PROG(CP, cp, cp, :)
AC_CHECK_PROG(MV, mv, mv, :)
AC_CHECK_PROG(LS, ls, ls, :)
AC_CHECK_PROG(SED, sed, sed, :)
+AC_PROG_EGREP
+AC_CHECK_PROG(MKDIR, mkdir, [mkdir -p], :)
+AC_CHECK_PROG(RMDIR, rmdir, rmdir, :)
+
+AC_PROG_MAKE_SET
# Checks for libraries.
# Checks for library functions.
-cp pics.all pics.build
+$CP pics.all pics.build
AC_CONFIG_FILES([Makefile.common])
AC_OUTPUT
-#
-# Makefile - Makefile to build pic16 debug library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=..
+SUBDIRS = gstack
+MKLIB = libdebug.lib
-DIRS = gstack
-
-
-LIB = libdebug.lib
-
-all: build-libraries
-
-make-target: build-libraries
-
-build-libraries:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir ; \
- done;
- gplib -c $(LIB) gstack/*.o
- mv -v $(LIB) ../bin
-
-
-clean-intermediate:
- @for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean-intermediate ; \
- done ;
-
-clean:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean; \
- done ;
- rm -fv $(LIB)
-
-
-real-clean: clean
- find -name *.adb -print | xargs -- rm -fv ;
- find -name *.p -print | xargs -- rm -fv ;
- find -name *.d -print | xargs -- rm -fv ;
- find -name *.dump* -print | xargs -- rm -fv ;
-
-
-dep:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir dep; \
- done
+include $(topsrcdir)/Makefile.subdir
+++ /dev/null
-#
-# Makefile.rules - Common Makefile rules to build pic16
-# debug library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-
-include ../../Makefile.common
-
-PRJDIR = ../../../../..
-
-LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
-
-COMPILE_FLAGS += $(MODELFLAGS) $(OPT_FLAGS)
-
-CPPFLAGS := -nostdinc -I$(LIBC_INC_DIR)
-CFLAGS += --nostdinc -I$(LIBC_INC_DIR)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-
-all: build-library
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
-
-
-clean: clean-intermediate
- $(RM) -f $(LIB) *.o
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CPPFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done;
-
-include .depend
-#
-# Makefile - Makefile to build pic16 stack tracing support function
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-SRCS = gstack
-
-
-include ../Makefile.rules
-
-
-all: build-library
-
-build-library: $(OFILES)
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 support libraries
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=..
+SUBDIRS = ctype delay stdio stdlib utils
+MKLIB = libc18f.lib
-DIRS = ctype \
- delay \
- stdlib \
- stdio \
- string \
- utils
-
-LOBJS = $(patsubst %,%/*.o,$(DIRS))
-
-LIB = libc18f.lib
-
-all: build-libraries
-
-make-target: build-libraries
-
-build-libraries:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir ; \
- done;
- gplib -c $(LIB) $(LOBJS)
- mv -v $(LIB) ../bin
-
-
-clean-intermediate:
- @for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean-intermediate ; \
- done ;
-
-clean:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean; \
- done ;
- rm -fv $(LIB)
-
-
-real-clean: clean
- find -name *.adb -print | xargs -- rm -fv ;
- find -name *.p -print | xargs -- rm -fv ;
- find -name *.d -print | xargs -- rm -fv ;
- find -name *.dump* -print | xargs -- rm -fv ;
-
-
-dep:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir dep; \
- done
+include $(topsrcdir)/Makefile.subdir
+++ /dev/null
-#
-# Makefile.rules - Common Makefile rules to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-
-include ../../Makefile.common
-
-PRJDIR = ../../../../..
-
-LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
-
-#OPT_FLAGS += --pstack-model=large
-#OPT_FLAGS += --stack-auto
-
-COMPILE_FLAGS += $(MODELFLAGS)
-COMPILE_FLAGS += $(OPT_FLAGS)
-COMPILE_FLAGS += $(CSTD)
-
-
-CFLAGS = -I$(LIBC_INC_DIR)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-COFILES = $(patsubst %.c,%.o,$(CFILES))
-
-ASFLAGS = -I$(LIBC_INC_DIR) -p18f452 -D__18F452
-
-SFILES = $(patsubst %,%.S,$(S_SRCS))
-SOFILES = $(patsubst %.S,%.o,$(SFILES))
-
-OFILES = $(COFILES) $(SOFILES)
-
-.c.o:
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-.S.o:
- $(AS) $(ASFLAGS) -c $<
-
-all: build-library clean-intermediate-no-asm
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
-
-clean-intermediate-no-asm:
- $(RM) -f *.lst *.dump* *.p *.d *.adb
-
-
-clean: clean-intermediate
- $(RM) -f $(LIB) *.o
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done;
- if [ ! -e .depend ]; then touch .depend; fi;
-
-include .depend
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = iscntrl \
- isdigit \
- isgraph \
- islower \
- isprint \
- ispunct \
- isspace \
- isupper \
- isxdigit
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-CSRCS =
-
-S_SRCS = delay10tcy \
- delay100tcy \
- delay1ktcy \
- delay10ktcy \
- delay100ktcy \
- delay1mtcy
-
-
-SRCS = $(CSRCS)
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-
-#all: build-library
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = printf_tiny \
- printf_small \
- printf \
- sprintf \
- fprintf \
- vprintf \
- vsprintf \
- vfprintf \
- strmusart \
- strmmssp \
- strmgpsim \
- strmputchar \
- streams
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --no-peep
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = atof \
- atoi \
- atol \
- calloc \
- free \
- itoa \
- ltoa \
- malloc \
- memfree \
- memfreemax \
- memmisc \
- realloc \
- x_ftoa \
- putchar \
- rand \
- crc16
-
-S_SRCS = g_ftoa
-
-#CFILES = $(patsubst %,%.c,$(SRCS))
-#OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-#OPT_FLAGS += --stack-auto
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-#CFILES = $(patsubst %,%.c,$(SRCS))
-#OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-#.c.o
-# $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = memchr \
- memcmp \
- memcpy \
- memccpy \
- memmove \
- memrchr \
- memset \
- strcat \
- strchr \
- strcmp \
- strcpy \
- strcspn \
- strlen \
- strlwr \
- strncat \
- strncmp \
- strncpy \
- strpbrk \
- strrchr \
- strspn \
- strstr \
- strtok \
- strupr \
- memchrpgm \
- memchrram \
- memcpypgm2ram \
- memcpyram2ram \
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-CSRCS =
-
-S_SRCS = cnvfrac \
- cnvint \
- cvtdec
-
-SRCS = $(CSRCS)
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-
-#all: build-library
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build device libraries
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-include ../Makefile.common
-
-# The SDCC project directory
-PRJDIR = ../../../..
-
-# headers directory
-INCDIR = $(PRJDIR)/device/include
-
-
-# MCUs to build
-MCUS = $(shell cat ../pics.build)
-
-# Supported devices
-DEVS = $(patsubst %,18f%,$(MCUS))
-
-#DEVS = 18f242 \
-# 18f248 \
-# 18f252 \
-# 18f258 \
-# 18f442 \
-# 18f448 \
-# 18f452 \
-# 18f458 \
-# 18f1220 \
-# 18f2220 \
-# 18f6520 \
-# 18f6620 \
-# 18f6680 \
-# 18f6720 \
-# 18f8520 \
-# 18f8620 \
-# 18f8680 \
-# 18f8720
-
-
-# pic16 port specific headers
-PIC16_INCDIR = $(INCDIR)/pic16
-
-CFLAGS = -I$(PIC16_INCDIR)
-
-#COMPILE_FLAGS = --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(MODELFLAGS) --nostdinc
-
-
-CFILES = $(patsubst %,pic%.c, $(DEVS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-LFILES = $(patsubst %.c,%.lib,$(CFILES))
-
-PFILE = $(patsubst pic%.c,%,$<)
-LFILE = $(patsubst %.c,%.lib,$<)
-
-
-.c.o:
- $(CC) -p$(PFILE) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-%.lib: %.o
- $(AR) -c $@ $<
-
-all: make-lib
-
-make-lib: $(LFILES) clean-intermediate-no-asm
- @$(MV) -v $(LFILES) ../bin
-
-$(LFILES): $(OFILES)
-
-$(OFILES): $(CFILES)
-
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump*
-
-clean-intermediate-no-asm:
- $(RM) -f *.lst *.dump*
-
-clean: clean-intermediate
- $(RM) -f *.o
-
-real-clean: clean
- $(RM) -f .depend
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done
-
-include .depend
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+topsrcdir=..
+
+SUBDIRS =
+MKLIB = device_libs
+C_FILES = $(wildcard *.c)
+TARGETS = $(OBJS:.o=.lib)
+
+# allow invoking make without arguments (otherwise
+# [...]/devicelibs would be the default target)
+suball : all
+
+.PHONY : $(topsrcdir)/$(builddir)/device_libs
+
+$(topsrcdir)/$(builddir)/device_libs :
+ $(Q)$(foreach dev,$(C_FILES:.c=),make $(topsrcdir)/$(builddir)/$(dev).lib LIB_O=$(topsrcdir)/$(builddir)/$(dev).o;)
+
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 support libraries
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-MCUS = $(shell cat ../pics.build)
-
-PROCESSORS = $(MCUS)
-
-
-DIRS = adc i2c usart
-
-LOBJS = $(patsubst %,%/*.o,$(DIRS))
-
-# library name example libio18f8720.lib
-LIB = libio18f$(MMCU).lib
-
-all: build-libraries
-
-make-target: build-libraries
-
-build-libraries:
- for proc in $(PROCESSORS) ; do \
- echo "Building libraries for processor pic18f $$proc" ; \
- $(MAKE) -C . build-processor-library MMCU=$$proc ; \
- done ;
-
-# Should have externally specified PROC
-build-processor-library:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean ; \
- grep $(MMCU) "$${dir}.ignore" > /dev/null 2>&1 || $(MAKE) -C $$dir build-io-lib MCU=18f$(MMCU); \
- done;
- make invoke-gplib
- mv -v $(LIB) ../bin
+###########################################################
+### Makefile for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider@web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider@web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+
+topsrcdir=..
+
+SUBDIRS = adc i2c usart
+
+ifeq ($(origin IO_ARCH),undefined)
+include $(topsrcdir)/Makefile.common
+
+all clean clean-intermediate install : builddir
+ $(Q)cat $(topsrcdir)/pics.build \
+ | $(SED) -e "s,[ \t]*#.*$$,," \
+ | $(GREP) -v "^[ \t]*$$" \
+ | while read arch; do \
+ [ "x$${arch}" = "x" ] \
+ || MKLIB=libio18f$${arch}.lib $(MAKE) builddir=$(builddir)/$${arch} ARCH=$${arch} IO_ARCH=$${arch} $(MAKECMDGOALS) \
+ || exit 1; \
+ done
-# needed so that make updates the list of .o files correctly...
-invoke-gplib:
- gplib -c $(LIB) $(foreach dir,$(DIRS),$(wildcard $(dir)/*.o))
+include $(topsrcdir)/Makefile.rules
-clean-intermediate:
- @for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean-intermediate ; \
- done ;
-
-clean:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean; \
- done ;
- rm -fv $(LIB)
+else
+include $(topsrcdir)/Makefile.subdir
-real-clean: clean
- find -name *.adb -print | xargs -- rm -fv ;
- find -name *.p -print | xargs -- rm -fv ;
- find -name *.d -print | xargs -- rm -fv ;
- find -name *.dump* -print | xargs -- rm -fv ;
-
+# prevent library to be build in $(SUBDIRS) as well
+unexport MKLIB
-dep:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir dep; \
- done
+endif
+++ /dev/null
-#
-# Makefile.rules - Common Makefile rules to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-
-include ../../Makefile.common
-
-PRJDIR = ../../../../..
-
-LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
-
-
-COMPILE_FLAGS += $(MODELFLAGS)
-COMPILE_FLAGS += -p$(MCU)
-COMPILE_FLAGS += $(OPT_FLAGS)
-#COMPILE_FLAGS += --i-code-in-asm
-COMPILE_FLAGS += $(CSTD)
-
-OPT_FLAGS2 +=
-
-CFLAGS = -I$(LIBC_INC_DIR) $(OPT_FLAGS2)
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-all:
- @echo "Please make target \`build-io-lib' setting"
- @echo "MCU= to the target device (i.e. MCU=18f452)"
-
-
-build-io-lib: build-library clean-intermediate-no-asm
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
-
-clean-intermediate-no-asm:
- $(RM) -f *.lst *.dump* *.p *.d *.adb
-
-
-clean: clean-intermediate
- $(RM) -f $(LIB) *.o
-
-ttest:
- $(MAKE) -C ./ build-io-lib MCU=18f452
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done;
-
-include .depend
-#
-# Makefile - Makefile to build pic16 AD convertion library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# $Id$
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = adcbusy \
- adcclose \
- adcconv \
- adcopen \
- adcread \
- adcsetch
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --denable-peeps --optimize-goto --obanksel=2
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 C Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = i2cack \
- i2cclose \
- i2cdrdy \
- i2cidle \
- i2cnack \
- i2copen \
- i2creadc \
- i2creads \
- i2crestart \
- i2cstart \
- i2cstop \
- i2cwritec \
- i2cwrites
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --no-peep
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 USART communications library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2005
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# $Id$
-#
+topsrcdir=../..
-include ../Makefile.rules
-
-SRCS = uclose \
- ugetc \
- uopen \
- usartd \
- ubusy \
- udrdy \
- ugets \
- uputc \
- uputs
-
-#ubaud
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-DEBUG=
-#COMPILE_FLAGS += --pomit-config-words --pomit-ivt --no-peep
-COMPILE_FLAGS += $(DEBUG)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-build-library: $(OFILES)
+SUBDIRS =
+TARGETS =
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 Math Library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# $Id$
-#
-#
+topsrcdir=..
-include ../Makefile.common
-
-PRJDIR = ../../../..
-
-LIB = libm18f.lib
-
-SRCS = acosf \
- asincosf \
- asinf \
- atan2f \
- atanf \
- ceilf \
- cosf \
- coshf \
- cotf \
- errno \
- expf \
- fabsf \
- floorf \
- frexpf \
- ldexpf \
- log10f \
- logf \
- modff \
- powf \
- sincosf \
- sincoshf \
- sinf \
- sinhf \
- sqrtf \
- tancotf \
- tanf \
- tanhf
-
-COMPILE_FLAGS += $(MODELFLAGS) $(OPT_FLAGS)
-COMPILE_FLAGS += $(CSTD)
-
-CFLAGS += -I $(PRJDIR)/device/include/pic16
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-all: build-library
-
-build-library: $(LIB)
-
-$(LIB): $(OFILES)
- @echo Creating $(LIB) ...
- @for object in $(OFILES) ; do \
- if [ ! -e $(LIB) ]; then \
- $(AR) -c $(LIB) $$object ; \
- else \
- $(AR) -r $(LIB) $$object ; \
- fi; \
- echo -n "$$object " ; \
- done ;
- @echo
- @mv -v $(LIB) ../bin
-
-
-all-clean: clean
-
-clean-intermediate:
- @echo Removing intermediate files ...
- $(RM) -f *.lst *.asm
-
-clean: clean-intermediate
- $(RM) -f $(LIB) *.o
-
-dep .depend:
- -rm .depend
- @for source in $(CFILES); do \
- $(CC) $(MM) $(CFLAGS) $$source > .tmpdepend ; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend ; \
- $(RM) -f .tmpdepend; \
- done
-
-include .depend
+SUBDIRS =
+MKLIB = libm18f.lib
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 support libraries
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=..
+SUBDIRS = char fixed16x16 float gptr int long
+ # lregs
+MKLIB = libsdcc.lib
-DIRS = char \
- int \
- long \
- float \
- gptr
-
-# lregs
-# fixed16_16
-
-LOBJS = $(patsubst %,%/*.o,$(DIRS))
-
-LIB = libsdcc.lib
-
-all: build-libraries
-
-make-target: build-libraries
-
-build-libraries:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir ; \
- done;
- gplib -c $(LIB) $(LOBJS)
- mv -v $(LIB) ../bin
-
-
-clean-intermediate:
- @for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean-intermediate ; \
- done ;
-
-clean:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir clean; \
- done ;
- rm -fv $(LIB)
-
-
-real-clean: clean
- find -name *.adb -print | xargs -- rm -fv ;
- find -name *.p -print | xargs -- rm -fv ;
- find -name *.d -print | xargs -- rm -fv ;
- find -name *.dump* -print | xargs -- rm -fv ;
-
-
-dep:
- for dir in $(DIRS) ; do \
- $(MAKE) -C $$dir dep; \
- done
+include $(topsrcdir)/Makefile.subdir
+++ /dev/null
-#
-# Makefile.rules - Common Makefile rules to build pic16
-# support libraries
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-
-include ../../Makefile.common
-
-PRJDIR = ../../../../..
-
-LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
-
-DEBUG =
-
-OPT_FLAGS += --optimize-cmp
-#OPT_FLAGS += --stack-auto
-
-COMPILE_FLAGS += $(MODELFLAGS)
-COMPILE_FLAGS += $(OPT_FLAGS) $(DEBUG)
-COMPILE_FLAGS += $(CSTD)
-
-CPPFLAGS := -nostdinc $(CFLAGS) -I$(LIBC_INC_DIR)
-
-CFLAGS += --nostdinc -I$(LIBC_INC_DIR)
-
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-COFILES = $(patsubst %.c,%.o,$(CFILES))
-
-SFILES = $(patsubst %,%.S,$(AS_SRCS))
-SOFILES = $(patsubst %.S,%.o,$(SFILES))
-
-OFILES = $(COFILES) $(SOFILES)
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-.S.o:
- $(AS) -I $(LIBC_INC_DIR) -c $<
-
-
-all: build-library clean-intermediate-no-asm
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
-
-clean-intermediate-no-asm:
- $(RM) -f *.lst *.dump* *.p *.d *.adb
-
-clean: clean-intermediate
- $(RM) -f $(LIB) *.o
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CPPFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done;
- if [ ! -e .depend ]; then touch .depend ; fi ;
-include .depend
-#
-# Makefile - Makefile to build pic16 char support library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-LIB = sdccchar.lib
-
-SRCS = divschar \
- divuchar \
- modschar \
- moduchar
-
-#SRCS =
-
-# modschar \
-# moduchar
-
-#AS_SRCS = divchar \
-# modchar
-
-
-include ../Makefile.rules
-
-
-all: build-library
-
-build-library: $(LIB)
-
-$(LIB): $(OFILES)
- @echo Creating $(LIB) ...
- @for object in $(OFILES) ; do \
- if [ ! -e $(LIB) ]; then \
- $(AR) -c $(LIB) $$object ; \
- else \
- $(AR) -r $(LIB) $$object ; \
- fi; \
- echo -n "$$object " ; \
- done ;
- @echo
-
\ No newline at end of file
+include $(topsrcdir)/Makefile.subdir
--- /dev/null
+topsrcdir=../..
+
+SUBDIRS =
+
+include $(topsrcdir)/Makefile.subdir
--- /dev/null
+
+;
+; fps16x162schar.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162schar
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_fps16x162schar____fps16x162schar code
+___fps16x162schar:
+
+ movlw 0x04
+ movff PLUSW1, PRODL
+
+ movlw 0x03
+ movf PLUSW1, w
+
+ btfss PRODL, 7
+ bra @1
+ negf WREG
+
+@1:
+ return
+
+ end
--- /dev/null
+
+float __fps16x162sfloat(__fixed16x16 fixd)
+{
+ union {
+ __fixed16x16 fix;
+ unsigned long value;
+ } u;
+ float tmp=0, exp=2;
+
+ u.fix = fixd;
+ tmp = (u.value & 0xffff0000) >> 16;
+
+ while(u.value) {
+ u.value &= 0xffff;
+ if(u.value & 0x8000)tmp += 1/exp;
+ exp *= 2;
+ u.value <<= 1;
+ }
+
+ return (tmp);
+}
--- /dev/null
+
+;
+; fps16x162sint.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162sint
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW2 equ 0xfdb
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_fps16x162sint____fps16x162sint code
+___fps16x162sint:
+
+ movlw 0x04
+ movff PLUSW1, PRODL
+
+ movlw 0x03
+ movf PLUSW1, w
+
+ btfss PRODL, 7
+ bra @1
+
+ bcf PRODL, 7
+
+ comf WREG, f
+ comf PRODL, f
+ infsnz WREG, f
+ incf PRODL, f
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; fps16x162slong.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162slong
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW2 equ 0xfdb
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+; Internal registers
+.registers udata_ovr 0x0000
+r0x00 res 1
+r0x01 res 1
+r0x02 res 1
+r0x03 res 1
+
+
+S_fps16x162slong____fps16x162slong code
+___fps16x162slong:
+
+ movlw 0x04
+ movff PLUSW1, PRODL
+
+ movlw 0x03
+ movf PLUSW1, w
+
+ clrf PRODH
+ clrf FSR0L
+
+ btfss PRODL, 7
+ bra @1
+
+ bcf PRODL, 7
+ comf WREG, f
+ comf PRODL, f
+ comf PRODH, f
+ comf FSR0L, f
+
+ incfsz WREG, f
+ bra @1
+ incfsz PRODL, f
+ bra @1
+ incfsz PRODH, f
+ bra @1
+ incf FSR0L, f
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; fps16x162uchar.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162uchar
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW2 equ 0xfdb
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+; Internal registers
+.registers udata_ovr 0x0000
+r0x00 res 1
+r0x01 res 1
+r0x02 res 1
+r0x03 res 1
+
+
+S_fps16x162uchar____fps16x162uchar code
+___fps16x162uchar:
+
+ ; normally would read from 0x04 but since we haven't setup
+ ; a stack frame, then read from 0x04 - 1 (VR)
+
+ movlw 0x03
+ movf PLUSW1, w
+
+ return
+
+ end
--- /dev/null
+
+;
+; fps16x162uint.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162uint
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW2 equ 0xfdb
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+; Internal registers
+.registers udata_ovr 0x0000
+r0x00 res 1
+r0x01 res 1
+r0x02 res 1
+r0x03 res 1
+
+
+S_fps16x162uint____fps16x162uint code
+___fps16x162uint:
+
+ movlw 0x04
+ movff PLUSW1, PRODL
+
+ movlw 0x03
+ movf PLUSW1, w
+
+ return
+
+ end
--- /dev/null
+
+;
+; fps16x162ulong.S - convert fixed16x16 to signed char
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___fps16x162ulong
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW2 equ 0xfdb
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+; Internal registers
+.registers udata_ovr 0x0000
+r0x00 res 1
+r0x01 res 1
+r0x02 res 1
+r0x03 res 1
+
+
+S_fps16x162ulong____fps16x162ulong code
+___fps16x162ulong:
+
+ movlw 0x04
+ movff PLUSW1, PRODL
+
+ movlw 0x7f
+ andwf PRODL, f
+
+ movlw 0x03
+ movf PLUSW1, w
+
+
+
+ clrf PRODH
+ clrf FSR0L
+
+ return
+
+ end
--- /dev/null
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+__fixed16x16 __fps16x16_add(__fixed16x16 a, __fixed16x16 b)
+{
+ volatile union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ u1.value += u2.value;
+
+ return (u1.fix);
+}
--- /dev/null
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+__fixed16x16 __fps16x16_div(__fixed16x16 a, __fixed16x16 b)
+{
+ volatile union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ u1.value = ((u1.value << 6) / u2.value) << 10;
+
+ return (u1.fix);
+}
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_eq.c - compare two __fixed16x16 values for equality
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_eq (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value == u2.value);
+}
+
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_gt.c - compare two __fixed16x16 values
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_gt (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value > u2.value);
+}
+
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_gteq.c - compare two __fixed16x16 values
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_gteq (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value >= u2.value);
+}
+
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_lt.c - compare two __fixed16x16 values
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_lt (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value < u2.value);
+}
+
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_lteq.c - compare two __fixed16x16 values
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_lteq (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value <= u2.value);
+}
+
--- /dev/null
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+__fixed16x16 __fps16x16_mul(__fixed16x16 a, __fixed16x16 b)
+{
+ volatile union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ u1.value = (u1.value >> 4) * (u2.value >> 4) >> 8;
+
+ return (u1.fix);
+}
--- /dev/null
+/*-------------------------------------------------------------------------
+ fps16x16_neq.c - compare two __fixed16x16 values for inequality
+
+ written by - Raphael Neider, rneider@web.de (2005)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+ $Id$
+-------------------------------------------------------------------------*/
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+char
+__fps16x16_neq (__fixed16x16 a, __fixed16x16 b)
+{
+ union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ return (u1.value != u2.value);
+}
+
--- /dev/null
+
+union u_t {
+ long value;
+ __fixed16x16 fix;
+};
+
+__fixed16x16 __fps16x16_sub(__fixed16x16 a, __fixed16x16 b)
+{
+ volatile union u_t u1, u2;
+
+ u1.fix = a;
+ u2.fix = b;
+
+ u1.value -= u2.value;
+
+ return (u1.fix);
+}
--- /dev/null
+
+;
+; schar2fps16x16.S - convert signed char to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___schar2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_schar2fps16x16____schar2fps16x16 code
+___schar2fps16x16:
+
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ clrf WREG
+ clrf PRODL
+ clrf FSR0L
+
+ btfss PRODH, 7
+ bra @1
+
+ comf PRODH, f
+ comf FSR0L, f
+
+ infsnz PRODH, f
+ incf FSR0L, f
+
+ bsf FSR0L, 7
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; sint2fps16x16.S - convert signed char to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___sint2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_sint2fps16x16____sint2fps16x16 code
+___sint2fps16x16:
+
+ movlw 0x02
+ movff PLUSW1, FSR0L
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ clrf WREG
+ clrf PRODL
+
+ btfss FSR0L, 7
+ bra @1
+
+
+ comf PRODH, f
+ comf FSR0L, f
+
+ infsnz PRODH, f
+ incf FSR0L, f
+
+ bsf FSR0L, 7
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; slong2fps16x16.S - convert signed long to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___slong2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_slong2fps16x16____slong2fps16x16 code
+___slong2fps16x16:
+
+ movlw 0x02
+ movff PLUSW1, FSR0L
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ btfss FSR0L, 7
+ bra @1
+
+ comf PRODH, f
+ comf FSR0L, f
+
+ infsnz PRODH, f
+ incf FSR0L, f
+
+ bsf FSR0L, 7
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; uchar2fps16x16.S - convert signed char to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___uchar2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_uchar2fps16x16____uchar2fps16x16 code
+___uchar2fps16x16:
+
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ clrf WREG
+ clrf PRODL
+ clrf FSR0L
+
+ bcf FSR0L, 7
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; uint2fps16x16.S - convert signed char to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___uint2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_uint2fps16x16____uint2fps16x16 code
+___uint2fps16x16:
+
+ movlw 0x02
+ movff PLUSW1, FSR0L
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ clrf WREG
+ clrf PRODL
+
+ bcf FSR0L, 7
+
+@1:
+ return
+
+ end
--- /dev/null
+
+;
+; ulong2fps16x16.S - convert signed long to fixed16x16
+;
+; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
+;
+;
+; $Id$
+;
+
+ radix dec
+
+;--------------------------------------------------------
+; public variables in this module
+;--------------------------------------------------------
+ global ___ulong2fps16x16
+
+;--------------------------------------------------------
+; Equates to used internal registers
+;--------------------------------------------------------
+STATUS equ 0xfd8
+WREG equ 0xfe8
+FSR0L equ 0xfe9
+FSR1L equ 0xfe1
+FSR2L equ 0xfd9
+POSTDEC1 equ 0xfe5
+PREINC1 equ 0xfe4
+PLUSW1 equ 0xfe3
+PRODL equ 0xff3
+PRODH equ 0xff4
+
+
+S_ulong2fps16x16____ulong2fps16x16 code
+___ulong2fps16x16:
+
+ movlw 0x02
+ movff PLUSW1, FSR0L
+ movlw 0x01
+ movff PLUSW1, PRODH
+
+ bcf FSR0L, 7
+
+@1:
+ return
+
+ end
-#
-# Makefile - Makefile to build pic16 float support library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-LIB = sdccfloat.lib
-
-SRCS = fs2schar \
- fs2sint \
- fs2slong \
- fs2uchar \
- fs2uint \
- fs2ulong \
- fsadd \
- fsdiv \
- fseq \
- fsgt \
- fslt \
- fsmul \
- fsneq \
- fssub \
- schar2fs \
- sint2fs \
- slong2fs \
- uchar2fs \
- uint2fs \
- ulong2fs
-
-LOCAL_FLAGS =
-COMPILE_FLAGS += $(LOCAL_FLAGS)
-
-include ../Makefile.rules
-
-all: build-library
-
-build-library: $(LIB)
-
-$(LIB): $(OFILES)
- @echo Creating $(LIB) ...
- @for object in $(OFILES) ; do \
- if [ ! -e $(LIB) ]; then \
- $(AR) -c $(LIB) $$object ; \
- else \
- $(AR) -r $(LIB) $$object ; \
- fi; \
- echo -n "$$object " ; \
- done ;
- @echo
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 generic pointer support library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-SRCS = gptrget1 \
- gptrget2 \
- gptrget3 \
- gptrget4 \
- gptrput1 \
- gptrput2 \
- gptrput3 \
- gptrput4
-
-
-include ../Makefile.rules
-
-#OFILES += gptrcommon.o
-
-
-all: build-library
-
-#gptrcommon.o: gptrcommon.S
-# $(AS) -c $< -o $@
-
-build-library: $(OFILES)
-# @$(CP) -v $(OFILES) ../../bin
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 int upport library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-LIB = sdccint.lib
-
-SRCS = divsint \
- divuint \
- modsint \
- moduint \
- mulint
-
-include ../Makefile.rules
-
-
-all: build-library
-
-build-library: $(LIB)
-
-$(LIB): $(OFILES)
- @echo Creating $(LIB) ...
- @for object in $(OFILES) ; do \
- if [ ! -e $(LIB) ]; then \
- $(AR) -c $(LIB) $$object ; \
- else \
- $(AR) -r $(LIB) $$object ; \
- fi; \
- echo adding $$object ; \
- done ;
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 long support library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-LIB = sdcclong.lib
-
-SRCS = divslong \
- divulong \
- modslong \
- modulong \
- mullong
-
-include ../Makefile.rules
-
-
-all: build-library
-
-build-library: $(LIB)
-
-$(LIB): $(OFILES)
- @echo Creating $(LIB) ...
- @for object in $(OFILES) ; do \
- if [ ! -e $(LIB) ]; then \
- $(AR) -c $(LIB) $$object ; \
- else \
- $(AR) -r $(LIB) $$object ; \
- fi; \
- echo adding $$object ; \
- done ;
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build pic16 local register store/restore
-# support library
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=../..
+SUBDIRS =
-SRCS = lrst \
- lrrest
-
-
-include ../Makefile.rules
-
-
-all: build-library
-
-build-library: $(OFILES)
+include $(topsrcdir)/Makefile.subdir
-#
-# Makefile - Makefile to build startup files
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
+topsrcdir=..
+SUBDIRS =
+TARGETS = $(OBJS)
-PRJDIR = ../../../..
-include ../Makefile.common
-
-
-SRCS = crt0 \
- crt0i \
- crt0iz
-
-
-# add nostdinc and nostdlib for this device libraries
-COMPILE_FLAGS += $(MODELFLAGS) $(OPT_FLAGS)
-COMPILE_FLAGS += --nostdinc --nostdlib --fommit-frame-pointer
-
-CFLAGS += $(CSTD)
-
-CFILES = $(patsubst %,%.c,$(SRCS))
-OFILES = $(patsubst %.c,%.o,$(CFILES))
-
-
-%.o: %.c
- $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
-
-
-all: build-library
- @$(CP) -v $(OFILES) ../bin
-
-build-library: compile-sources
-
-compile-sources: $(OFILES)
-
-
-clean:
- rm -f *.o *.lst *.asm
-
-
-clean-intermediate:
- $(RM) -f *.lst *.asm *.dump*
-
-dep .depend:
- rm -f .depend
- for temp in $(CFILES); do \
- $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
- $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
- $(RM) -f .tmpdepend; \
- done
-
-include .depend
+include $(topsrcdir)/Makefile.subdir
"eeprom" { count(); TKEYWORDSDCC(EEPROM); }
"__eeprom" { count(); TKEYWORD(EEPROM); }
"float" { count(); return(FLOAT); }
+"fixed16x16" { count(); TKEYWORDSDCC(FIXED16X16); }
+"__fixed16x16" { count(); TKEYWORD(FIXED16X16); }
"flash" { count(); TKEYWORDSDCC(CODE); }
"__flash" { count(); TKEYWORD(CODE); }
"for" { count(); return(FOR); }
%token TYPEDEF EXTERN STATIC AUTO REGISTER CODE EEPROM INTERRUPT SFR SFR16 SFR32
%token AT SBIT REENTRANT USING XDATA DATA IDATA PDATA VAR_ARGS CRITICAL
%token NONBANKED BANKED SHADOWREGS WPARAM
-%token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID BIT
+%token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE FIXED16X16 CONST VOLATILE VOID BIT
%token STRUCT UNION ENUM ELIPSIS RANGE FAR
%token CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
%token NAKED JAVANATIVE OVERLAY
SPEC_NOUN($$) = V_FLOAT;
ignoreTypedefType = 1;
}
+ | FIXED16X16 {
+ $$=newLink(SPECIFIER);
+ SPEC_NOUN($$) = V_FIXED16X16;
+ ignoreTypedefType = 1;
+ }
| XDATA {
$$ = newLink (SPECIFIER);
SPEC_SCLS($$) = S_XDATA ;
break;
case RESULT_TYPE_CHAR:
if (IS_CHAR (tree->etype) ||
- IS_FLOAT(tree->etype))
+ IS_FLOAT(tree->etype) ||
+ IS_FIXED(tree->etype))
return tree;
newLink = newCharLink();
break;
case V_FLOAT:
typeofv = TYPEOF_FLOAT;
break;
+ case V_FIXED16X16:
+ typeofv = TYPEOF_FIXED16X16;
+ break;
case V_CHAR:
typeofv = TYPEOF_CHAR;
break;
case '+':
/* if adding the same thing change to left shift by 1 */
if (IC_LEFT (ic)->key == IC_RIGHT (ic)->key &&
- !IS_FLOAT (operandType (IC_RESULT (ic))))
+ !(IS_FLOAT (operandType (IC_RESULT (ic)))
+ || IS_FIXED(operandType (IC_RESULT (ic)))))
{
ic->op = LEFT_OP;
IC_RIGHT (ic) = operandFromLit (1);
getSize (type)));
dwAddTagChild (dwRootTag, tp);
break;
+
+ case V_FIXED16X16:
+ tp = dwNewTag (DW_TAG_base_type);
+ dwAddTagAttr (tp, dwNewAttrConst (DW_AT_encoding,
+ DW_ATE_float));
+ dwAddTagAttr (tp, dwNewAttrString (DW_AT_name, "fixed16x16"));
+ dwAddTagAttr (tp, dwNewAttrConst (DW_AT_byte_size,
+ getSize (type)));
+ dwAddTagChild (dwRootTag, tp);
+ break;
case V_CHAR:
tp = dwNewTag (DW_TAG_base_type);
return;
}
+ if (IS_FIXED(ltype)) {
+ // anything will do
+ return;
+ }
+
if (!IS_UNSIGNED(val->type) && v<0) {
negative=1;
if (IS_UNSIGNED(ltype) && (pedantic>1)) {
opetype = getSpec (operandType (op));
if (IS_FLOAT (opetype))
fprintf (file, "%g {", SPEC_CVAL (opetype).v_float);
+ if (IS_FIXED16X16 (opetype))
+ fprintf (file, "%g {", doubleFromFixed16x16(SPEC_CVAL (opetype).v_fixed16x16));
else
fprintf (file, "0x%x {", (unsigned) floatFromVal (op->operand.valOperand));
printTypeChain (operandType (op), file);
retval = operandFromLit (operandLitValue (left) ==
operandLitValue (right));
}
+ else
+ if (IS_FIXED16X16 (let) ||
+ IS_FIXED16X16 (ret))
+ {
+ retval = operandFromLit (operandLitValue (left) ==
+ operandLitValue (right));
+ }
else
{
/* this op doesn't care about signedness */
!IS_BITFIELD (type) &&
!IS_FLOAT (type) &&
!IS_FLOAT (optype) &&
+ !IS_FIXED (type) &&
+ !IS_FIXED (optype) &&
((IS_SPEC (type) && IS_SPEC (optype)) ||
(!IS_SPEC (type) && !IS_SPEC (optype))))
{
/* code generated for 1 byte * 1 byte literal = 2 bytes result is more
efficient in most cases than 2 bytes result = 2 bytes << literal
if port has 1 byte muldiv */
- if (p2 && !IS_FLOAT (letype)
+ if (p2 && !IS_FLOAT (letype) && !IS_FIXED (letype)
&& !((resultType == RESULT_TYPE_INT) && (getSize (resType) != getSize (ltype))
&& (port->support.muldiv == 1))
&& strcmp (port->target, "pic16") != 0 /* don't shift for pic */
right shift */
if (IS_LITERAL (retype) &&
!IS_FLOAT (letype) &&
+ !IS_FIXED (letype) &&
IS_UNSIGNED(letype) &&
(p2 = powof2 ((TYPE_UDWORD)
floatFromVal (right->operand.valOperand)))) {
IC_RESULT (ic)->isaddr = (isarray ? 1 : 0);
/* if left or right is a float */
- if (IS_FLOAT (ltype) || IS_FLOAT (rtype))
+ if (IS_FLOAT (ltype) || IS_FLOAT (rtype)
+ || IS_FIXED (ltype) || IS_FIXED (rtype))
ic->supportRtn = 1;
ADDTOCHAIN (ic);
/* if left or right is a float then support
routine */
- if (IS_FLOAT (ltype) || IS_FLOAT (rtype))
+ if (IS_FLOAT (ltype) || IS_FLOAT (rtype)
+ || IS_FIXED (ltype) || IS_FIXED (rtype))
ic->supportRtn = 1;
ADDTOCHAIN (ic);
werror(W_SIZEOF_VOID);
if (IS_FLOAT (rvtype))
ic = newiCode ('+', rv, operandFromValue (constFloatVal ("1.0")));
+ else
+ if (IS_FIXED16X16 (rvtype))
+ ic = newiCode ('+', rv, operandFromValue (constFixed16x16Val ("1.0")));
else
ic = newiCode ('+', rv, operandFromLit (size));
werror(W_SIZEOF_VOID);
if (IS_FLOAT (roptype))
ic = newiCode ('+', rop, operandFromValue (constFloatVal ("1.0")));
+ else
+ if (IS_FIXED16X16 (roptype))
+ ic = newiCode ('+', rop, operandFromValue (constFixed16x16Val ("1.0")));
else
ic = newiCode ('+', rop, operandFromLit (size));
IC_RESULT (ic) = result = newiTempOperand (roptype, 0);
werror(W_SIZEOF_VOID);
if (IS_FLOAT (rvtype))
ic = newiCode ('-', rv, operandFromValue (constFloatVal ("1.0")));
+ else
+ if (IS_FIXED16X16 (rvtype))
+ ic = newiCode ('-', rv, operandFromValue (constFixed16x16Val ("1.0")));
else
ic = newiCode ('-', rv, operandFromLit (size));
werror(W_SIZEOF_VOID);
if (IS_FLOAT (roptype))
ic = newiCode ('-', rop, operandFromValue (constFloatVal ("1.0")));
+ else
+ if (IS_FIXED16X16 (roptype))
+ ic = newiCode ('-', rop, operandFromValue (constFixed16x16Val ("1.0")));
else
ic = newiCode ('-', rop, operandFromLit (size));
IC_RESULT (ic) = result = newiTempOperand (roptype, 0);
IS_STRUCT (rtype) ||
IS_INT (rtype) ||
IS_CHAR (rtype) ||
- IS_FLOAT (rtype));
+ IS_FLOAT (rtype) ||
+ IS_FIXED (rtype));
if (!isLvaluereq(lvl))
op = geniCodeRValue (op, TRUE);
op != OR_OP)
ic->supportRtn = 1;
+ /* if comparing a fixed type use support functions */
+ if (IS_FIXED(ctype))
+ ic->supportRtn = 1;
+
ADDTOCHAIN (ic);
return IC_RESULT (ic);
}
left = IC_LEFT (ic);
right = IC_RIGHT (ic);
- switch (ic->op)
- {
- case '+':
- func = __fsadd;
- break;
- case '-':
- func = __fssub;
- break;
- case '/':
- func = __fsdiv;
- break;
- case '*':
- func = __fsmul;
- break;
- case EQ_OP:
- func = __fseq;
- break;
- case NE_OP:
- func = __fsneq;
- break;
- case '<':
- func = __fslt;
- break;
- case '>':
- func = __fsgt;
- break;
- case LE_OP:
- func = __fslteq;
- break;
- case GE_OP:
- func = __fsgteq;
- break;
- }
+ if(IS_FLOAT(operandType( IC_RIGHT( ic ) ))) {
+ switch (ic->op)
+ {
+ case '+':
+ func = __fsadd;
+ break;
+ case '-':
+ func = __fssub;
+ break;
+ case '/':
+ func = __fsdiv;
+ break;
+ case '*':
+ func = __fsmul;
+ break;
+ case EQ_OP:
+ func = __fseq;
+ break;
+ case NE_OP:
+ func = __fsneq;
+ break;
+ case '<':
+ func = __fslt;
+ break;
+ case '>':
+ func = __fsgt;
+ break;
+ case LE_OP:
+ func = __fslteq;
+ break;
+ case GE_OP:
+ func = __fsgteq;
+ break;
+ }
+ } else
+ if(IS_FIXED16X16 (operandType (IC_RIGHT(ic)))) {
+ switch (ic->op)
+ {
+ case '+':
+ func = __fps16x16_add;
+ break;
+ case '-':
+ func = __fps16x16_sub;
+ break;
+ case '/':
+ func = __fps16x16_div;
+ break;
+ case '*':
+ func = __fps16x16_mul;
+ break;
+ case EQ_OP:
+ func = __fps16x16_eq;
+ break;
+ case NE_OP:
+ func = __fps16x16_neq;
+ break;
+ case '<':
+ func = __fps16x16_lt;
+ break;
+ case '>':
+ func = __fps16x16_gt;
+ break;
+ case LE_OP:
+ func = __fps16x16_lteq;
+ break;
+ case GE_OP:
+ func = __fps16x16_gteq;
+ break;
+ }
+ }
+
/* if float support routines NOT compiled as reentrant */
if (!options.float_rent)
}
}
}
+
+ if(compareType (type, fixed16x16Type) == 1) {
+ func = __fp16x16conv[0][3][0];
+ goto found;
+ }
+
+ assert (0);
+found:
+
+ /* if float support routines NOT compiled as reentrant */
+ if (!options.float_rent)
+ {
+ /* first one */
+ if (IS_REGPARM (FUNC_ARGS(func->type)->etype))
+ {
+ newic = newiCode (SEND, IC_RIGHT (ic), NULL);
+ newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
+ }
+ else
+ {
+ newic = newiCode ('=', NULL, IC_RIGHT (ic));
+ IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
+ }
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = linenno;
+
+ }
+ else
+ {
+ /* push the left */
+ if (IS_REGPARM (FUNC_ARGS(func->type)->etype)) {
+ newic = newiCode (SEND, IC_RIGHT (ic), NULL);
+ newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
+ }
+ else
+ {
+ newic = newiCode (IPUSH, IC_RIGHT (ic), NULL);
+ newic->parmPush = 1;
+ bytesPushed += getSize(operandType(IC_RIGHT(ic)));
+ }
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = linenno;
+
+ }
+
+ /* make the call */
+ newic = newiCode (CALL, operandFromSymbol (func), NULL);
+ IC_RESULT (newic) = IC_RESULT (ic);
+ newic->parmBytes+=bytesPushed;
+ ebp->hasFcall = 1;
+ if (currFunc)
+ FUNC_HASFCALL (currFunc->type) = 1;
+
+ if(TARGET_IS_PIC16) {
+ /* normally these functions aren't marked external, so we can use their
+ * _extern field to marked as already added to symbol table */
+
+ if(!SPEC_EXTR(func->etype)) {
+ memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
+
+ SPEC_EXTR(func->etype) = 1;
+ seg = SPEC_OCLS( func->etype );
+ addSet(&seg->syms, func);
+ }
+ }
+
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = linenno;
+}
+
+/*----------------------------------------------------------------------*/
+/* cnvToFixed16x16Cast - converts casts to fixed16x16 to function calls */
+/*----------------------------------------------------------------------*/
+static void
+cnvToFixed16x16Cast (iCode * ic, eBBlock * ebp)
+{
+ iCode *ip, *newic;
+ symbol *func = NULL;
+ sym_link *type = operandType (IC_RIGHT (ic));
+ int linenno = ic->lineno;
+ int bwd, su;
+ int bytesPushed=0;
+
+ ip = ic->next;
+ /* remove it from the iCode */
+ remiCodeFromeBBlock (ebp, ic);
+ /* depending on the type */
+ for (bwd = 0; bwd < 3; bwd++)
+ {
+ for (su = 0; su < 2; su++)
+ {
+ if (compareType (type, __multypes[bwd][su]) == 1)
+ {
+ func = __fp16x16conv[0][bwd][su];
+ goto found;
+ }
+ }
+ }
assert (0);
found:
newic->lineno = lineno;
}
+/*--------------------------------------------------------------------------*/
+/* cnvFromFixed16x16Cast - converts casts from fixed16x16 to function calls */
+/*--------------------------------------------------------------------------*/
+static void
+cnvFromFixed16x16Cast (iCode * ic, eBBlock * ebp)
+{
+ iCode *ip, *newic;
+ symbol *func = NULL;
+ sym_link *type = operandType (IC_LEFT (ic));
+ int lineno = ic->lineno;
+ int bwd, su;
+ int bytesPushed=0;
+
+ ip = ic->next;
+ /* remove it from the iCode */
+ remiCodeFromeBBlock (ebp, ic);
+
+ /* depending on the type */
+ for (bwd = 0; bwd < 3; bwd++)
+ {
+ for (su = 0; su < 2; su++)
+ {
+ if (compareType (type, __multypes[bwd][su]) == 1)
+ {
+ func = __fp16x16conv[1][bwd][su];
+ goto found;
+ }
+ }
+ }
+
+ if (compareType (type, floatType) == 1)
+ {
+ func = __fp16x16conv[1][3][0];
+ goto found;
+ }
+
+ assert (0);
+found:
+
+ /* if float support routines NOT compiled as reentrant */
+ if (!options.float_rent)
+ {
+ /* first one */
+ if (IS_REGPARM (FUNC_ARGS(func->type)->etype)) {
+ newic = newiCode (SEND, IC_RIGHT (ic), NULL);
+ newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
+ }
+ else
+ {
+ newic = newiCode ('=', NULL, IC_RIGHT (ic));
+ IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
+ }
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = lineno;
+
+ }
+ else
+ {
+
+ /* push the left */
+ if (IS_REGPARM (FUNC_ARGS(func->type)->etype)) {
+ newic = newiCode (SEND, IC_RIGHT (ic), NULL);
+ newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
+ }
+ else
+ {
+ newic = newiCode (IPUSH, IC_RIGHT (ic), NULL);
+ newic->parmPush = 1;
+ bytesPushed += getSize(operandType(IC_RIGHT(ic)));
+ }
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = lineno;
+
+ }
+
+ /* make the call */
+ newic = newiCode (CALL, operandFromSymbol (func), NULL);
+ IC_RESULT (newic) = IC_RESULT (ic);
+ newic->parmBytes+=bytesPushed;
+ ebp->hasFcall = 1;
+ if (currFunc)
+ FUNC_HASFCALL (currFunc->type) = 1;
+
+ if(TARGET_IS_PIC16) {
+ /* normally these functions aren't marked external, so we can use their
+ * _extern field to marked as already added to symbol table */
+
+ if(!SPEC_EXTR(func->etype)) {
+ memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
+
+ SPEC_EXTR(func->etype) = 1;
+ seg = SPEC_OCLS( func->etype );
+ addSet(&seg->syms, func);
+ }
+ }
+
+ addiCodeToeBBlock (ebp, newic, ip);
+ newic->lineno = lineno;
+}
+
extern operand *geniCodeRValue (operand *, bool);
/*-----------------------------------------------------------------*/
converted to function calls */
if ((IS_CONDITIONAL (ic) ||
IS_ARITHMETIC_OP (ic)) &&
- (IS_FLOAT (operandType (IC_RIGHT (ic)))))
+ (IS_FLOAT (operandType (IC_RIGHT (ic)))
+ || IS_FIXED( operandType (IC_RIGHT (ic)))))
{
cnvToFcall (ic, ebbs[i]);
cnvFromFloatCast (ic, ebbs[i]);
else if (IS_FLOAT (operandType (IC_LEFT (ic))))
cnvToFloatCast (ic, ebbs[i]);
+ if (IS_FIXED16X16 (operandType (IC_RIGHT (ic))))
+ cnvFromFixed16x16Cast (ic, ebbs[i]);
+ else if (IS_FIXED16X16 (operandType (IC_LEFT (ic))))
+ cnvToFixed16x16Cast (ic, ebbs[i]);
}
// Easy special case which avoids function call: modulo by a literal power
return "int";
}
case V_FLOAT: return "float";
+ case V_FIXED16X16: return "fixed16x16";
case V_CHAR: return "char";
case V_VOID: return "void";
case V_STRUCT: return "struct";
if ((SPEC_NOUN(etype)==V_CHAR ||
SPEC_NOUN(etype)==V_FLOAT ||
+ SPEC_NOUN(etype)==V_FIXED16X16 ||
SPEC_NOUN(etype)==V_DOUBLE ||
SPEC_NOUN(etype)==V_VOID) &&
(etype->select.s._short || SPEC_LONG(etype))) {
werror (E_LONG_OR_SHORT_INVALID, noun, name);
}
if ((SPEC_NOUN(etype)==V_FLOAT ||
+ SPEC_NOUN(etype)==V_FIXED16X16 ||
SPEC_NOUN(etype)==V_DOUBLE ||
SPEC_NOUN(etype)==V_VOID) &&
(etype->select.s._signed || SPEC_USIGN(etype))) {
return p;
}
+/*------------------------------------------------------------------*/
+/* newFixed16x16Link - a new Float type */
+/*------------------------------------------------------------------*/
+sym_link *
+newFixed16x16Link ()
+{
+ sym_link *p;
+
+ p = newLink (SPECIFIER);
+ SPEC_NOUN (p) = V_FIXED16X16;
+
+ return p;
+}
+
/*------------------------------------------------------------------*/
/* newLongLink() - new long type */
/*------------------------------------------------------------------*/
return (IS_LONG (p) ? LONGSIZE : INTSIZE);
case V_FLOAT:
return FLOATSIZE;
+ case V_FIXED16X16:
+ return (4);
case V_CHAR:
return CHARSIZE;
case V_VOID:
return (IS_LONG (p) ? LONGSIZE * 8 : INTSIZE * 8);
case V_FLOAT:
return FLOATSIZE * 8;
+ case V_FIXED16X16:
+ return (32);
case V_CHAR:
return CHARSIZE * 8;
case V_VOID:
/* which ever is greater in size */
if (IS_FLOAT (etype1) || IS_FLOAT (etype2))
rType = newFloatLink ();
+ else
+ /* if both are fixed16x16 then result is float */
+ if (IS_FIXED16X16(etype1) && IS_FIXED16X16(etype2))
+ rType = newFixed16x16Link();
+ else
+ if (IS_FIXED16X16(etype1) && IS_FLOAT (etype2))
+ rType = newFloatLink ();
+ if (IS_FLOAT (etype1) && IS_FIXED16X16 (etype2) )
+ rType = newFloatLink ();
else
/* if both are bitvars choose the larger one */
if (IS_BITVAR (etype1) && IS_BITVAR (etype2))
fprintf (of, "float");
break;
+ case V_FIXED16X16:
+ fprintf (of, "fixed16x16");
+ break;
+
case V_STRUCT:
fprintf (of, "struct %s", SPEC_STRUCT (type)->tag);
break;
fprintf (of, "float");
break;
+ case V_FIXED16X16:
+ fprintf (of, "fixed16x16");
+ break;
+
case V_STRUCT:
fprintf (of, "struct %s", SPEC_STRUCT (type)->tag);
break;
symbol *__fsgt;
symbol *__fsgteq;
+symbol *__fps16x16_add;
+symbol *__fps16x16_sub;
+symbol *__fps16x16_mul;
+symbol *__fps16x16_div;
+symbol *__fps16x16_eq;
+symbol *__fps16x16_neq;
+symbol *__fps16x16_lt;
+symbol *__fps16x16_lteq;
+symbol *__fps16x16_gt;
+symbol *__fps16x16_gteq;
+
/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
symbol *__muldiv[3][3][2];
/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */
sym_link *__multypes[3][2];
/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */
symbol *__conv[2][3][2];
+/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/FLOAT, SIGNED/USIGNED */
+symbol *__fp16x16conv[2][4][2];
/* Dims: shift left/shift right, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
symbol *__rlrr[2][3][2];
sym_link *floatType;
+sym_link *fixed16x16Type;
static char *
_mangleFunctionName(char *in)
/* 'i' - int */
/* 'l' - long */
/* 'f' - float */
+/* 'q' - fixed16x16 */
/* 'v' - void */
/* '*' - pointer - default (GPOINTER) */
/* modifiers - 'u' - unsigned */
r->class = SPECIFIER;
SPEC_NOUN(r) = V_FLOAT;
break;
+ case 'q':
+ r->class = SPECIFIER;
+ SPEC_NOUN(r) = V_FIXED16X16;
+ break;
case 'v':
r->class = SPECIFIER;
SPEC_NOUN(r) = V_VOID;
};
const char *sbwd[] =
{
- "char", "int", "long"
+ "char", "int", "long", "fixed16x16",
+ };
+ const char *fp16x16sbwd[] =
+ {
+ "char", "int", "long", "float",
};
const char *ssu[] =
{
}
floatType = newFloatLink ();
+ fixed16x16Type = newFixed16x16Link ();
for (bwd = 0; bwd < 3; bwd++)
{
__fsgt = funcOfType ("__fsgt", CHARTYPE, floatType, 2, options.float_rent);
__fsgteq = funcOfType ("__fsgteq", CHARTYPE, floatType, 2, options.float_rent);
+ __fps16x16_add = funcOfType ("__fps16x16_add", fixed16x16Type, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_sub = funcOfType ("__fps16x16_sub", fixed16x16Type, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_mul = funcOfType ("__fps16x16_mul", fixed16x16Type, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_div = funcOfType ("__fps16x16_div", fixed16x16Type, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_eq = funcOfType ("__fps16x16_eq", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_neq = funcOfType ("__fps16x16_neq", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_lt = funcOfType ("__fps16x16_lt", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_lteq = funcOfType ("__fps16x16_lteq", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_gt = funcOfType ("__fps16x16_gt", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+ __fps16x16_gteq = funcOfType ("__fps16x16_gteq", CHARTYPE, fixed16x16Type, 2, options.float_rent);
+
+
for (tofrom = 0; tofrom < 2; tofrom++)
{
for (bwd = 0; bwd < 3; bwd++)
}
}
+ for (tofrom = 0; tofrom < 2; tofrom++)
+ {
+ for (bwd = 0; bwd < 4; bwd++)
+ {
+ for (su = 0; su < 2; su++)
+ {
+ if (tofrom)
+ {
+ SNPRINTF (buffer, sizeof(buffer), "__fps16x162%s%s", ssu[su], fp16x16sbwd[bwd]);
+ if(bwd == 3) {
+ __fp16x16conv[tofrom][bwd][su] = funcOfType (buffer, floatType, fixed16x16Type, 1, options.float_rent);
+ } else
+ __fp16x16conv[tofrom][bwd][su] = funcOfType (buffer, __multypes[bwd][su], fixed16x16Type, 1, options.float_rent);
+ }
+ else
+ {
+ SNPRINTF (buffer, sizeof(buffer), "__%s%s2fps16x16", ssu[su], fp16x16sbwd[bwd]);
+ if(bwd == 3) {
+ __fp16x16conv[tofrom][bwd][su] = funcOfType (buffer, fixed16x16Type, floatType, 1, options.float_rent);
+ } else
+ __fp16x16conv[tofrom][bwd][su] = funcOfType (buffer, fixed16x16Type, __multypes[bwd][su], 1, options.float_rent);
+ }
+ }
+ }
+ }
+
/*
for (muldivmod = 0; muldivmod < 3; muldivmod++)
{
TYPEOF_CHAR,
TYPEOF_LONG,
TYPEOF_FLOAT,
+ TYPEOF_FIXED16X16,
TYPEOF_BIT,
TYPEOF_BITFIELD,
TYPEOF_SBIT,
{
V_INT = 1,
V_FLOAT,
+ V_FIXED16X16,
V_CHAR,
V_VOID,
V_STRUCT,
TYPE_DWORD v_long; /* 4 bytes: long constant value */
TYPE_UDWORD v_ulong; /* 4 bytes: unsigned long constant value */
double v_float; /* floating point constant value */
- struct symbol *v_enum; /* ptr to enum_list if enum==1 */
+ TYPE_UDWORD v_fixed16x16; /* 4 bytes: fixed floating point constant value */
+ struct symbol *v_enum; /* ptr 2 enum_list if enum==1 */
}
const_val;
struct structdef *v_struct; /* structure pointer */
#define IS_BIT(x) (IS_SPEC(x) && (x->select.s.noun == V_BIT || \
x->select.s.noun == V_SBIT ))
#define IS_FLOAT(x) (IS_SPEC(x) && x->select.s.noun == V_FLOAT)
-#define IS_ARITHMETIC(x) (IS_INTEGRAL(x) || IS_FLOAT(x))
+#define IS_FIXED16X16(x) (IS_SPEC(x) && x->select.s.noun == V_FIXED16X16)
+#define IS_FIXED(x) (IS_FIXED16X16(x))
+#define IS_ARITHMETIC(x) (IS_INTEGRAL(x) || IS_FLOAT(x) || IS_FIXED(x))
#define IS_AGGREGATE(x) (IS_ARRAY(x) || IS_STRUCT(x))
#define IS_LITERAL(x) (IS_SPEC(x) && x->select.s.sclass == S_LITERAL)
#define IS_CODE(x) (IS_SPEC(x) && SPEC_SCLS(x) == S_CODE)
extern symbol *__fsgt;
extern symbol *__fsgteq;
+extern symbol *__fps16x16_add;
+extern symbol *__fps16x16_sub;
+extern symbol *__fps16x16_mul;
+extern symbol *__fps16x16_div;
+extern symbol *__fps16x16_eq;
+extern symbol *__fps16x16_neq;
+extern symbol *__fps16x16_lt;
+extern symbol *__fps16x16_lteq;
+extern symbol *__fps16x16_gt;
+extern symbol *__fps16x16_gteq;
+
/* Dims: mul/div/mod, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
extern symbol *__muldiv[3][3][2];
/* Dims: BYTE/WORD/DWORD SIGNED/UNSIGNED */
extern sym_link *__multypes[3][2];
/* Dims: to/from float, BYTE/WORD/DWORD, SIGNED/USIGNED */
extern symbol *__conv[2][3][2];
+/* Dims: to/from fixed16x16, BYTE/WORD/DWORD/FLOAT, SIGNED/USIGNED */
+extern symbol *__fp16x16conv[2][4][2];
/* Dims: shift left/shift right, BYTE/WORD/DWORD, SIGNED/UNSIGNED */
extern symbol *__rlrr[2][3][2];
#define LONGTYPE __multypes[2][0]
#define ULONGTYPE __multypes[2][1]
-
extern sym_link *floatType;
+extern sym_link *fixed16x16Type;
#include "SDCCval.h"
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
+#include <math.h>
+
#ifdef _WIN32
#include <ctype.h>
#include <windows.h>
return (SDCC_BUILD_NUMBER);
}
+/*-----------------------------------------------------------------*/
+/* doubleFromFixed16x16 - convert a fixed16x16 to double */
+/*-----------------------------------------------------------------*/
+double doubleFromFixed16x16(TYPE_UDWORD value)
+{
+#if 0
+ /* This version is incorrect negative values. */
+ double tmp=0, exp=2;
+
+ tmp = (value & 0xffff0000) >> 16;
+
+ while(value) {
+ value &= 0xffff;
+ if(value & 0x8000)tmp += 1/exp;
+ exp *= 2;
+ value <<= 1;
+ }
+
+ return (tmp);
+#else
+ return ((double)(value * 1.0) / (double)(1UL << 16));
+#endif
+}
+
+TYPE_UDWORD fixed16x16FromDouble(double value)
+{
+#if 0
+ /* This version is incorrect negative values. */
+ unsigned int tmp=0, pos=16;
+ TYPE_UDWORD res;
+
+ tmp = floor( value );
+ res = tmp << 16;
+ value -= tmp;
+
+ tmp = 0;
+ while(pos--) {
+ value *= 2;
+ if(value >= 1.0)tmp |= (1 << pos);
+ value -= floor( value );
+ }
+
+ res |= tmp;
+
+ return (res);
+#else
+ return (TYPE_UDWORD)(value * (double)(1UL << 16));
+#endif
+}
#if defined(HAVE_VSNPRINTF) || defined(HAVE_VSPRINTF)
/* return SDCC build number */
const char *getBuildNumber(void);
+/* convert a fixed16x16 type to double */
+double doubleFromFixed16x16(TYPE_UDWORD value);
+
+/* convert a double type to fixed16x16 */
+TYPE_UDWORD fixed16x16FromDouble(double value);
+
/* snprintf, by hook or by crook. */
size_t SDCCsnprintf(char *, size_t, const char *, ...);
TYPE_DWORD sval=0;
TYPE_UDWORD uval=0;
- if (IS_FLOAT(val->type) || IS_CHAR(val->type))
+ if (IS_FLOAT(val->type) || IS_FIXED(val->type) || IS_CHAR(val->type))
return val;
if (SPEC_LONG(val->type)) {
static value *cheapestVal (value *val)
{
- if (IS_FLOAT (val->type) || IS_CHAR (val->type))
+ if (IS_FLOAT (val->type) || IS_FIXED (val->type) || IS_CHAR (val->type))
return val;
/* - signed/unsigned must not be changed.
return val;
}
+/*-----------------------------------------------------------------*/
+/* constFixed16x16Val - converts a FIXED16X16 constant to value */
+/*-----------------------------------------------------------------*/
+value *
+constFixed16x16Val (char *s)
+{
+ value *val = newValue ();
+ double sval;
+
+ if (sscanf (s, "%lf", &sval) != 1)
+ {
+ werror (E_INVALID_FLOAT_CONST, s);
+ return constVal ("0");
+ }
+
+ val->type = val->etype = newLink (SPECIFIER);
+ SPEC_NOUN (val->type) = V_FLOAT;
+ SPEC_SCLS (val->type) = S_LITERAL;
+ SPEC_CVAL (val->type).v_fixed16x16 = fixed16x16FromDouble ( sval );
+
+ return val;
+}
+
/*-----------------------------------------------------------------*/
/* constVal - converts an INTEGER constant into a cheapest value */
/*-----------------------------------------------------------------*/
if (SPEC_NOUN (val->etype) == V_FLOAT)
return (double) SPEC_CVAL (val->etype).v_float;
+ if (SPEC_NOUN (val->etype) == V_FIXED16X16)
+ return (double) doubleFromFixed16x16( SPEC_CVAL (val->etype).v_fixed16x16 );
+
if (SPEC_LONG (val->etype))
{
if (SPEC_USIGN (val->etype))
/* depending on type */
if (SPEC_NOUN (val->etype) == V_FLOAT)
SPEC_CVAL (val->etype).v_float = -1.0 * SPEC_CVAL (val->etype).v_float;
+ if (SPEC_NOUN (val->etype) == V_FIXED16X16)
+ SPEC_CVAL (val->etype).v_fixed16x16 = -SPEC_CVAL (val->etype).v_fixed16x16;
else
{
if (SPEC_LONG (val->etype))
if (IS_FLOAT (val->type))
SPEC_CVAL (val->type).v_float = floatFromVal (lval) * floatFromVal (rval);
+ else
+ if (IS_FIXED16X16 (val->type))
+ SPEC_CVAL (val->type).v_fixed16x16 = fixed16x16FromDouble(floatFromVal (lval) * floatFromVal (rval));
/* signed and unsigned mul are the same, as long as the precision of the
result isn't bigger than the precision of the operands. */
else if (SPEC_LONG (val->type))
if (IS_FLOAT (val->type))
SPEC_CVAL (val->type).v_float = floatFromVal (lval) / floatFromVal (rval);
+ else
+ if (IS_FIXED16X16 (val->type))
+ SPEC_CVAL (val->type).v_fixed16x16 = fixed16x16FromDouble( floatFromVal (lval) / floatFromVal (rval) );
else if (SPEC_LONG (val->type))
{
if (SPEC_USIGN (val->type))
if (IS_FLOAT (val->type))
SPEC_CVAL (val->type).v_float = floatFromVal (lval) + floatFromVal (rval);
+ else
+ if (IS_FIXED16X16 (val->type))
+ SPEC_CVAL (val->type).v_fixed16x16 = fixed16x16FromDouble( floatFromVal (lval) + floatFromVal (rval) );
else if (SPEC_LONG (val->type))
{
if (SPEC_USIGN (val->type))
if (IS_FLOAT (val->type))
SPEC_CVAL (val->type).v_float = floatFromVal (lval) - floatFromVal (rval);
+ else
+ if (IS_FIXED16X16 (val->type))
+ SPEC_CVAL (val->type).v_fixed16x16 = fixed16x16FromDouble( floatFromVal (lval) - floatFromVal (rval) );
else if (SPEC_LONG (val->type))
{
if (SPEC_USIGN (val->type))
{
SPEC_CVAL (val->type).v_int = floatFromVal (lval) == floatFromVal (rval);
}
+ else
+ if (SPEC_NOUN(lval->type) == V_FIXED16X16 ||
+ SPEC_NOUN(rval->type) == V_FIXED16X16)
+ {
+ SPEC_CVAL (val->type).v_int = floatFromVal (lval) == floatFromVal (rval);
+ }
else
{
/* integrals: ignore signedness */
{
SPEC_CVAL (val->type).v_int = floatFromVal (lval) != floatFromVal (rval);
}
+ else
+ if (SPEC_NOUN(lval->type) == V_FIXED16X16 ||
+ SPEC_NOUN(rval->type) == V_FIXED16X16)
+ {
+ SPEC_CVAL (val->type).v_int = floatFromVal (lval) != floatFromVal (rval);
+ }
else
{
/* integrals: ignore signedness */
if (SPEC_NOUN (val->etype) == V_FLOAT)
SPEC_CVAL (val->etype).v_float = fval;
+ else if (SPEC_NOUN (val->etype) == V_FIXED16X16)
+ SPEC_CVAL (val->etype).v_fixed16x16 = fixed16x16FromDouble( fval );
else if (SPEC_NOUN (val->etype) == V_BIT ||
SPEC_NOUN (val->etype) == V_SBIT)
SPEC_CVAL (val->etype).v_uint = l ? 1 : 0;
void resolveIvalSym (initList *, sym_link *);
value *valFromType (sym_link *);
value *constFloatVal (char *);
+value *constFixed16x16Val (char *);
int getNelements (sym_link *, initList *);
value *valForArray (struct ast *);
value *valForStructElem (struct ast *, struct ast *);
ENTRY (SIGNED);
ENTRY (UNSIGNED);
ENTRY (FLOAT);
+ ENTRY (FIXED16X16);
ENTRY (DOUBLE);
ENTRY (CONST);
ENTRY (VOLATILE);
TEST (altlex_testparse ("enum") == ENUM);
TEST (altlex_testparse ("extern") == EXTERN);
TEST (altlex_testparse ("float") == FLOAT);
+ TEST (altlex_testparse ("fixed16x16") == FIXED16X16);
TEST (altlex_testparse ("for") == FOR);
TEST (altlex_testparse ("goto") == GOTO);
TEST (altlex_testparse ("if") == IF);
case V_CHAR: fprintf (cdbFilePtr, "SC"); break;
case V_VOID: fprintf (cdbFilePtr, "SV"); break;
case V_FLOAT: fprintf (cdbFilePtr, "SF"); break;
+ case V_FIXED16X16: fprintf(cdbFilePtr, "SQ"); break;
case V_STRUCT:
fprintf (cdbFilePtr, "ST%s", SPEC_STRUCT (type)->tag);
break;
optype = operandType(IC_LEFT(ic));
rtype = operandType(IC_RESULT(ic));
+
/* if float then do float stuff */
- if (IS_FLOAT(optype)) {
- genUminusFloat(IC_LEFT(ic),IC_RESULT(ic));
- goto release;
+ if (IS_FLOAT(optype) || IS_FIXED(optype)) {
+ if(IS_FIXED(optype))
+ debugf("implement fixed16x16 type\n", 0);
+
+ genUminusFloat(IC_LEFT(ic),IC_RESULT(ic));
+ goto release;
}
/* otherwise subtract from zero by taking the 2's complement */
offset = 0 ;
if(AOP_TYPE(right) == AOP_LIT) {
- if(!IS_FLOAT(operandType( right )))
+ if(!(IS_FLOAT(operandType( right )) || IS_FIXED(operandType(right))))
lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
- else {
+ else{
union {
unsigned long lit_int;
float lit_float;
} info;
+
+ if(IS_FIXED16X16(operandType(right))) {
+ lit = (unsigned long)fixed16x16FromDouble( floatFromVal( AOP(right)->aopu.aop_lit));
+ } else {
/* take care if literal is a float */
info.lit_float = floatFromVal(AOP(right)->aopu.aop_lit);
lit = info.lit_int;
+ }
}
}
/* if it is a float then it gets tricky */
/* otherwise it is fairly simple */
- if (!IS_FLOAT(val->type)) {
+ if (!(IS_FLOAT(val->type) || IS_FIXED(val->type))) {
unsigned long v = (unsigned long) floatFromVal(val);
return ( (v >> (offset * 8)) & 0xff);
}
+ if(IS_FIXED16X16(val->type)) {
+ unsigned long v = (unsigned long)fixed16x16FromDouble( floatFromVal( val ) );
+
+ return ( (v >> (offset * 8)) & 0xff);
+ }
+
/* it is type float */
fl.f = (float) floatFromVal(val);
#ifdef WORDS_BIGENDIAN
"_naked",
"shadowregs",
"wparam",
+ "fixed16x16",
// "bit",
// "idata",