69 lines
1.3 KiB
Plaintext
69 lines
1.3 KiB
Plaintext
# Emplacement de la suite de cross-compilation
|
|
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/10.03/staging_dir
|
|
TOOLCHAIN1 = $(TOOLCHAIN_PREFIX)/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1
|
|
TOOLCHAIN2 = $(TOOLCHAIN_PREFIX)/target-mips_uClibc-0.9.30.1
|
|
TOOLCHAIN_BIN = $(TOOLCHAIN1)/usr/bin
|
|
|
|
# Compilateur
|
|
CC = $(TOOLCHAIN_BIN)/mips-openwrt-linux-gcc
|
|
|
|
# Autres outils
|
|
AR = ar
|
|
RANLIB = ranlib
|
|
RM = rm -f
|
|
|
|
# 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)
|
|
CFLAGS += -D DEBUG
|
|
DEPFLAGS=-MMD
|
|
XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
|
|
PICFLAG=-fPIC
|
|
#STRIPFLAGS= -Wl,-s
|
|
#LDFLAGS=
|
|
LATHEROS = -L$(TOOLCHAIN1)/lib -L$(TOOLCHAIN1)/usr/lib -L$(TOOLCHAIN2)/usr/lib
|
|
IATHEROS = -I$(TOOLCHAIN1)/usr/include -I$(TOOLCHAIN2)/usr/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 :
|
|
@make help
|