owlps/libowlps-client/Makefile

62 lines
988 B
Makefile

include ../common.mk
# General variables
LIB_CIBLE=libowlps-client
# Targets to build
STATIC=$(LIB_CIBLE).a
HEADER=owlps-client.h
# Library components
OBJS=$(LIB_CIBLE).o
# Flags
LIBOWLPS_DIR = ../libowlps
CFLAGS = -O2 -Wall -Wextra -Wstrict-prototypes -O -I$(LIBOWLPS_DIR)
#CFLAGS += -g -O0
CFLAGS += -D DEBUG
DEPFLAGS=-MMD
XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
PICFLAG=-fPIC
#STRIPFLAGS= -Wl,-s
#LDFLAGS=
## Standard targets ##
.PHONY : all static clean purge help
all : static
static : $(STATIC)
%.o : %.c $(HEADER)
$(CC) $(XCFLAGS) -c $<
# Static library compilation
$(STATIC) : $(OBJS)
$(RM) $@
$(AR) cru $@ $^
$(RANLIB) $@
## Cleaning ##
clean :
@$(RM) *~ *.o *.d
purge : clean
@$(RM) $(STATIC)
## Help ##
help :
@echo "Needed libraries:"
@echo " libowlps-dev"
@echo
@echo "Targets:"
@echo " static (default target): Builds the static library."
@echo
@echo " clean: Deletes the temporary files."
@echo " purge: Deletes the built binaries."