owlps/libowlps-resultreader/Makefile_drone

83 lines
1.5 KiB
Plaintext

# Emplacement de la suite de cross-compilation
TOOLCHAIN_PREFIX = /arm
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/bin
TOOLCHAIN_USR = $(TOOLCHAIN_PREFIX)/arm-none-linux-gnueabi/libc/usr
TOOLCHAIN_USR_2 = $(TOOLCHAIN_PREFIX)/arm-none-linux-gnueabi/libc
# Compilateur
CC = $(TOOLCHAIN_BIN)/arm-none-linux-gnueabi-gcc
# Autres outils
AR = ar
RANLIB = ranlib
RM = rm -f
# Variables générales
LIB_CIBLE = libowlps-resultreader
VERSION = 1.0
# Cibles à construire
STATIC = $(LIB_CIBLE).a
HEADER = owlps-resultreader.h
EXAMPLE = owlps-resultreader-udp
# Composition de la bibliothèque
OBJS = $(LIB_CIBLE).o
# Flags
LIBOWLPS_DIR = ../libowlps
CFLAGS = -O2 -Wall -Wextra -Wstrict-prototypes -O -I$(LIBOWLPS_DIR) -I.
#CFLAGS += -g -O0
CFLAGS += -D DEBUG
DEPFLAGS = -MMD
XCFLAGS = $(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
PICFLAG = -fPIC
#STRIPFLAGS = -Wl,-s
#LDFLAGS =
LATHEROS = -L$(TOOLCHAIN_USR_2)/lib/
IATHEROS = -I$(TOOLCHAIN_USR)/include/
## Cibles de compilation standard ##
.PHONY : all static clean purge help
all : static example
static : $(STATIC)
example : $(EXAMPLE)
# Cancel implicit make rule
%: %.c
%.o : %.c $(HEADER)
$(CC) $(XCFLAGS) $(IATHEROS) -c $<
% : %.o $(HEADER) $(STATIC)
$(CC) $(STRIPFLAGS) $(XCFLAGS) $(IATHEROS) -o $@ $< \
$(STATIC) -L$(LIBOWLPS_DIR) -lowlps -lrt
# Compilation de la bibliothèque statique
$(STATIC) : $(OBJS)
$(RM) $@
$(AR) cru $@ $^
$(RANLIB) $@
## Nettoyage ##
clean :
@$(RM) *~ *.o *.d
purge : clean
@$(RM) $(STATIC) $(EXAMPLE)
## Aide ##
help :
@make help
# Local Variables: *
# mode: makefile-gmake *
# End: *