#**************************************************************************
# Fichero makefile.
# --------------------------------------------------------------------------
# Licencia GPL. Juan Gonzalez Gomez
# --------------------------------------------------------------------------
#
#***************************************************************************

#--- Librerias estaticas
LIBSTARGATE_S  = libstargate-1.0.1.a

#---- Compilador
CC = gcc
CFLAGS = -I./libwiimote-0.4/src/



#---------------------------
#       OBJETIVOS
#---------------------------
    
#--------------------------
NAME3= test-skylamp
DEP3 = $(NAME3).o consola_io.o

NAME4= wiigl

NAME5= wii-lamp

NAME6= wii-servo
DEP6= $(NAME6).o consola_io.o sg-tramas-servos8.o


all: $(NAME3) $(NAME4) $(NAME5) $(NAME6)


$(NAME3): $(DEP3)
	    $(CC) -o $(NAME3) $(DEP3) -L. $(LIBSTARGATE_S)

clean::
	  rm -f $(NAME3) $(DEP3)  
    
    
$(NAME4): 
	    $(CC) -o $(NAME4) wiigl.c -L./libwiimote-0.4/lib/ -I./libwiimote-0.4/src/ \
      -lGL -lGLU -lglut -lcwiimote -lbluetooth -lm -Os -Wall -pipe    \
      -D_ENABLE_TILT -D_ENABLE_FORCE -g -O2 

clean::
	  rm -f $(NAME4)   


$(NAME5): 
	    $(CC) -o $(NAME5) $(NAME5).c consola_io.o -L./libwiimote-0.4/lib/ -I./libwiimote-0.4/src/ \
      -lGL -lGLU -lglut -lcwiimote -lbluetooth -lm -Os -Wall -pipe    \
      -L. $(LIBSTARGATE_S) -D_ENABLE_TILT -D_ENABLE_FORCE -g -O2 

clean::
	  rm -f $(NAME5) 



$(NAME6): $(DEP6)
	    $(CC) -o $(NAME6) $(DEP6) -L./libwiimote-0.4/lib/ \
      -lGL -lGLU -lglut -lcwiimote -lbluetooth -lm -Os -Wall -pipe    \
      -L. $(LIBSTARGATE_S) -g -O2 

wii-servo.o : wii-servo.c 
	    $(CC) -c wii-servo.c  -I./libwiimote-0.4/src/ -D_ENABLE_TILT -D_ENABLE_FORCE 

clean::
	  rm -f $(NAME6) $(DEP6)  



#--------------------------
#  REGLAS GENERICAS
#--------------------------
.c.o:		
		$(CC) $(CFLAGS) -c $<
