76 lines
1.6 KiB
Plaintext
76 lines
1.6 KiB
Plaintext
|
# Emplacement de la suite de cross-compilation
|
||
|
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/10.03
|
||
|
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin
|
||
|
TOOLCHAIN_USR = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr
|
||
|
TOOLCHAIN_USR_2 = $(TOOLCHAIN_PREFIX)/staging_dir/target-mips_uClibc-0.9.30.1/usr
|
||
|
|
||
|
# Compilateur
|
||
|
CC = $(TOOLCHAIN_BIN)/mips-openwrt-linux-gcc
|
||
|
|
||
|
# Autres outils
|
||
|
AR = ar
|
||
|
RANLIB = ranlib
|
||
|
RM = rm -fv
|
||
|
|
||
|
# Variables générales
|
||
|
LIB_CIBLE=libowlps-client
|
||
|
VERSION=1.0
|
||
|
|
||
|
# Cibles à construire
|
||
|
STATIC=$(LIB_CIBLE).a
|
||
|
HEADER=owlps-client.h
|
||
|
|
||
|
# Composition de la bibliothèque
|
||
|
OBJS=$(LIB_CIBLE).o
|
||
|
|
||
|
# Flags
|
||
|
LIBOWLPS_DIR = ../libowlps
|
||
|
CFLAGS = -O2 -Wall -Wextra -Wstrict-prototypes -O -I$(LIBOWLPS_DIR)
|
||
|
DEPFLAGS=-MMD
|
||
|
XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
|
||
|
PICFLAG=-fPIC
|
||
|
LIBS=-liw
|
||
|
#STRIPFLAGS= -Wl,-s
|
||
|
#LDFLAGS=
|
||
|
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
||
|
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
||
|
|
||
|
|
||
|
## Cibles de compilation standard ##
|
||
|
|
||
|
.PHONY : all static clean purge help
|
||
|
|
||
|
all : static
|
||
|
static : $(STATIC)
|
||
|
|
||
|
%.o : %.c $(HEADER)
|
||
|
$(CC) $(XCFLAGS) $(IATHEROS) -c $<
|
||
|
|
||
|
# Compilation de la bibliothèque statique
|
||
|
$(STATIC) : $(OBJS)
|
||
|
$(RM) $@
|
||
|
$(AR) cru $@ $^
|
||
|
$(RANLIB) $@
|
||
|
|
||
|
|
||
|
## Nettoyage ##
|
||
|
|
||
|
clean :
|
||
|
@$(RM) *~ *.o *.d
|
||
|
|
||
|
purge : clean
|
||
|
@$(RM) $(STATIC)
|
||
|
|
||
|
|
||
|
## Aide ##
|
||
|
|
||
|
help :
|
||
|
@echo "Bibliothèques nécessaires à la compilation :\n\
|
||
|
libowlps-dev\n\
|
||
|
\n\
|
||
|
Cibles possibles :\n\
|
||
|
static (cible par défaut) : Compile la bibliothèque statique (.a).\n\
|
||
|
\n\
|
||
|
clean : Supprime les fichiers temporaires.\n\
|
||
|
purge : Supprime le résultat de la compilation.\n\"
|