[Client] Add Makefile for ARDrone
This commit is contained in:
parent
e45c199130
commit
92e08673ca
|
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||
pthread_t send ;
|
||||
pthread_create(&send, NULL, thread_send, NULL) ;
|
||||
while(1)
|
||||
{
|
||||
{
|
||||
if (options.listening_port > 0)
|
||||
receive_position() ;
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ void check_configuration()
|
|||
#ifdef DEBUG
|
||||
fprintf(stderr, "Warning! You cannot wait for a server answer when"
|
||||
" you calibrate. Option -l ignored…\n") ;
|
||||
#endif // DEBUG
|
||||
#endif // DEBUG
|
||||
options.listening_port = 0 ;
|
||||
}
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ void create_socket()
|
|||
//owlclient_create_trx_socket(ip_labview, port_labview,
|
||||
// &server, options.iface) ;
|
||||
|
||||
sockreceivefd =
|
||||
sockreceivefd =
|
||||
owl_create_udp_listening_socket(options.listening_port) ;
|
||||
}
|
||||
|
||||
|
@ -399,18 +399,18 @@ void string2data(char* string_data)
|
|||
|
||||
char *delims = ";" ;
|
||||
|
||||
int type_req = 0 ;
|
||||
int count_algo= 0 ;
|
||||
int count_print = 0 ;
|
||||
int type_req = 0 ;
|
||||
int count_algo= 0 ;
|
||||
int count_print = 0 ;
|
||||
int onetime = 0 ;
|
||||
|
||||
|
||||
|
||||
while(onetime<1)
|
||||
{
|
||||
|
||||
|
||||
//Lecture Adresse Mac
|
||||
ptr = strtok(string_data, delims) ;
|
||||
if(ptr==NULL)
|
||||
if(ptr==NULL)
|
||||
{
|
||||
print_error("mac") ;
|
||||
break ;
|
||||
|
@ -419,7 +419,7 @@ void string2data(char* string_data)
|
|||
|
||||
//Lecture Type Request
|
||||
ptr = strtok(NULL, delims) ;
|
||||
if (ptr==NULL)
|
||||
if (ptr==NULL)
|
||||
{
|
||||
print_error("request") ;
|
||||
break ;
|
||||
|
@ -428,7 +428,7 @@ void string2data(char* string_data)
|
|||
|
||||
//Lecture TimeStamp1
|
||||
ptr = strtok(NULL, ".") ;
|
||||
if (ptr==NULL)
|
||||
if (ptr==NULL)
|
||||
{
|
||||
print_error("timestamp") ;
|
||||
break ;
|
||||
|
@ -437,7 +437,7 @@ void string2data(char* string_data)
|
|||
|
||||
//Lecture TimeStamp2
|
||||
ptr = strtok(NULL, ";") ;
|
||||
if (ptr==NULL)
|
||||
if (ptr==NULL)
|
||||
{
|
||||
print_error("timestamp") ;
|
||||
break ;
|
||||
|
@ -456,56 +456,56 @@ void string2data(char* string_data)
|
|||
|
||||
//Lecture du point X
|
||||
ptr = strtok(NULL, delims) ;
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_error ("algo");
|
||||
count_algo-- ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_error ("algo");
|
||||
count_algo-- ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
results[count_algo].x = atof(ptr) ;
|
||||
|
||||
//Lecture du point Y
|
||||
ptr = strtok(NULL, delims) ;
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_error ("algo");
|
||||
count_algo--;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_error ("algo");
|
||||
count_algo--;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
results[count_algo].y = atof(ptr) ;
|
||||
|
||||
//Lecture du point Z
|
||||
ptr = strtok(NULL, delims) ;
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror ("algo");
|
||||
count_algo--;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if(ptr==NULL)
|
||||
{
|
||||
if(count_algo==0)
|
||||
{
|
||||
print_error ("trame");
|
||||
break ;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror ("algo");
|
||||
count_algo--;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
results[count_algo].z = atof(ptr) ;
|
||||
|
||||
count_algo++;
|
||||
|
|
|
@ -42,7 +42,7 @@ typedef struct result result;
|
|||
|
||||
/* Struct */
|
||||
|
||||
struct result
|
||||
struct result
|
||||
{
|
||||
char algo[ALGO_STRLEN];
|
||||
float x;
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
# Emplacement de la suite de cross-compilation
|
||||
TOOLCHAIN_PREFIX = /arm
|
||||
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/bin
|
||||
TOOLCHAIN_USR = $(TOOLCHAIN_PREFIX)/arm-none-linux-gnueabi
|
||||
TOOLCHAIN_USR_2 = $(TOOLCHAIN_PREFIX)/arm-none-linux-gnueabi/libc
|
||||
|
||||
# Compilateur
|
||||
CC = $(TOOLCHAIN_BIN)/arm-none-linux-gnueabi-gcc
|
||||
|
||||
# Répertoire d'installation
|
||||
PREFIX=/usr/local
|
||||
INSTALL_DIR= $(PREFIX)/bin
|
||||
INSTALL_LIB= $(PREFIX)/lib
|
||||
INSTALL_INC= $(PREFIX)/include
|
||||
INSTALL_MAN= $(PREFIX)/share/man
|
||||
|
||||
# Commandes d'installation et de désinstallation
|
||||
RM=rm -fv
|
||||
CP=cp -v
|
||||
|
||||
# Cible
|
||||
TARGET=owlps-client
|
||||
HEADER=
|
||||
|
||||
# Flags
|
||||
LIBOWLPS_DIR = ../libowlps
|
||||
LIBOWLPSCLIENT_DIR = ../libowlps-client
|
||||
CFLAGS = -O2 -Wall -Wextra -Wstrict-prototypes -I.
|
||||
DEPFLAGS = -MMD
|
||||
XCFLAGS = $(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
|
||||
PICFLAG = -fPIC
|
||||
LOWLPS = -L$(LIBOWLPS_DIR) -lowlps
|
||||
LOWLPSA = $(LIBOWLPS_DIR)/libowlps.a
|
||||
LOWLPSCLIENTA = $(LIBOWLPSCLIENT_DIR)/libowlps-client.a
|
||||
LIBS = $(LOWLPSCLIENTA) -liw -lm -lrt
|
||||
DYNAMIC_LIBS = $(LOWLPS) $(LIBS)
|
||||
SEMISTATIC_LIBS = $(LOWLPSA) $(LIBS)
|
||||
STATIC_LIBS = $(LOWLPSA) $(LIBS)
|
||||
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
||||
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
||||
LDFLAGS = $(IATHEROS) $(LATHEROS)
|
||||
|
||||
|
||||
## Cibles de compilation standard ##
|
||||
|
||||
.PHONY: all semistatic static install uninstall clean purge help
|
||||
|
||||
semistatic: $(TARGET)
|
||||
static: $(TARGET).static
|
||||
all: semistatic static
|
||||
|
||||
# Cancel implicit make rule
|
||||
%: %.c
|
||||
|
||||
#%: %.o
|
||||
# $(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(DYNAMIC_LIBS)
|
||||
|
||||
%: %.o
|
||||
$(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(SEMISTATIC_LIBS)
|
||||
|
||||
%.static: %.o
|
||||
$(CC) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LDFLAGS) $(STATIC_LIBS) \
|
||||
-static
|
||||
|
||||
%.o: %.c $(HEADER)
|
||||
$(CC) $(XCFLAGS) $(IATHEROS) $(OWLPSFLAGS) -c $<
|
||||
|
||||
|
||||
## Installation / désinstallation ##
|
||||
|
||||
install : $(TARGET)
|
||||
@$(CP) $(TARGET) $(INSTALL_DIR)
|
||||
@cd $(INSTALL_DIR) ; chown root:root $(TARGET) ; chmod 755 $(TARGET)
|
||||
|
||||
uninstall :
|
||||
@$(RM) $(INSTALL_DIR)/$(TARGET)
|
||||
|
||||
|
||||
## Nettoyage ##
|
||||
|
||||
clean :
|
||||
@$(RM) -fv *~ *.o *.d
|
||||
|
||||
purge : clean
|
||||
@$(RM) -fv $(TARGET) $(TARGET).static $(TARGET)-drone
|
||||
|
||||
|
||||
## Aide ##
|
||||
|
||||
help :
|
||||
@echo -e "Bibliothèques nécessaires à la compilation :\n\
|
||||
libowlps1.0 (fournie)\n\
|
||||
\n\
|
||||
Cibles possibles :\n\
|
||||
$(TARGET) (cible par défaut) : Compile le programme $(TARGET).\n\
|
||||
$(TARGET).static : Compile le programme $(TARGET).static \
|
||||
(version sans lien dynamique).\n\
|
||||
$(TARGET).semistatic : Compile le programme $(TARGET).semistatic \
|
||||
(version sans lien dynamique vers libowlps).\n\
|
||||
install : Installe le programme $(TARGET).\n\
|
||||
uninstall : Désinstalle le programme $(TARGET).\n\
|
||||
clean : Supprime les fichiers temporaires.\n\
|
||||
purge : Supprime le résultat de la compilation.\n\
|
||||
\n\
|
||||
Note : l'installation se fait dans l'arborescence $(PREFIX). \
|
||||
Modifiez la variable PREFIX du Makefile pour changer ce comportement."
|
Loading…
Reference in New Issue