
#--------------------------------------------------------------------------------
# -- $Id: Makefile 2 2008-07-30 09:28:03Z mschneider $
# -- FILE:   Makefile
# -- AUTHOR: Markus Schneider
#--------------------------------------------------------------------------------

LIBNAME = bioloid.a

# -- DEFINITIONS --
CC      = /usr/bin/g++

CFLAGS  = -g -Wall
LFlags  = 

# -- OBJECT FILES --
OBJ = ax12.o axs1.o ftdi.o connection.o dynamixel.o packet.o packetparser.o serialport_d2xx.o serialport_ftdi.o serialportlogger.o syncwritepacket.o

all: lib

lib: $(OBJ)
	ar rcs $(LIBNAME) $(OBJ)

ftdi.o: ftdi.c
	gcc $(CFLAGS) -c ftdi.c

%.o: %.c
	$(CC) $(CFLAGS) -c $<

clean:
	-rm *.o
	-rm $(LIBNAME)

new: clean all

#--------------------------------------------------------------------------------
# FOOTNOTES
#--------------------------------------------------------------------------------
# 
# CLFAGS:
#       -ansi  Support all ANSI standard C programs.
#
#              This turns off certain features of GNU C that  are  incompatible
#              with  ANSI  C,  such as the asm, inline and typeof keywords, and
#              predefined macros such as unix and vax that identify the type of
#              system  you  are  using.   It  also  enables the undesirable and
#              rarely used ANSI trigraph feature, and disallows `$' as part  of
#              identifiers.
#
#
#       -Wall  All  of  the `-W' options combined.  These are all the options 
#              which pertain to usage that we recommend avoiding and that
#              we believe is easy to avoid, even in conjunction with macros.
#
#       -Dmacro
#              Define macro macro with the string `1' as its definition.
#
#       -Dmacro=defn
#              Define macro macro as defn.    All instances of `-D' on the com-
#              mand line are processed before any `-U' options.
#
#       -g     Produce debugging information in the operating  system's  native
#              format  (stabs,  COFF, XCOFF, or DWARF).  GDB can work with this
#              debugging information.
#
#              On most systems that use stabs format, `-g' enables use of extra
#              debugging information that only GDB can use; this extra informa-
#              tion makes debugging work better in GDB but will  probably  make
#              other  debuggers  crash  or  refuse to read the program.  If you
#              want to control for certain whether to generate the extra infor-
#              mation,   use   `-gstabs+',  `-gstabs',  `-gxcoff+',  `-gxcoff',
#              `-gdwarf+', or `-gdwarf' (see below).
#
#              Unlike most other C compilers, GNU CC allows  you  to  use  `-g'
#              with  `-O'.  The shortcuts taken by optimized code may occasion-
#              ally produce surprising results: some variables you declared may
#              not exist at all; flow of control may briefly move where you did
#              not expect it; some statements may not be executed because  they
#              compute  constant  results or their values were already at hand;
#              some statements may execute in  different  places  because  they
#              were moved out of loops.
#
#              Nevertheless it proves possible to debug optimized output.  This
#              makes it reasonable to use the optimizer for programs that might
#              have bugs.
#
#
# LDFLAGS:
#
#       -llibrary
#              Use the library named library when linking.
#
#              The  linker  searches a standard list of directories for the li-
#              brary, which is actually a file named `liblibrary.a'.  The link-
#              er  then uses this file as if it had been specified precisely by
#              name.
#
#              The directories searched include several standard system  direc-
#              tories plus any that you specify with `-L'.
#
#              Normally  the  files  found  this way are library files--archive
#              files whose members are object files.  The linker handles an ar-
#              chive  file by scanning through it for members which define sym-
#              bols that have so far been referenced but not defined.  However,
#              if  the  linker  finds an ordinary object file rather than a li-
#              brary, the object file is linked in the usual fashion.  The only
#              difference  between  using  an `-l' option and specifying a file
#              name is that `-l' surrounds library  with  `lib'  and  `.a'  and
#              searches several directories.
#
#
#--------------------------------------------------------------------------------
# SEE THE FOLLOWING MANUALS:  gcc(1), as(1), cpp(1), gdb(1), ld(1)
#--------------------------------------------------------------------------------

