Files
libcoap/Makefile.in
T
Olaf Bergmann 1a403845ca Made libcoap configurable
* moved Makefiles to Makefile.in
* test for tools, headers, libs and compiler features
* generate config.h which is included by coap.h
2010-10-18 12:09:51 +02:00

74 lines
1.5 KiB
Makefile

# Makefile for libcoap
# (c) 2010 Olaf Bergmann <bergmann@tzi.org>
# the library's version
VERSION:=@PACKAGE_VERSION@
# tools
@SET_MAKE@
SHELL = /bin/sh
MKDIR = mkdir
abs_builddir = @abs_builddir@
top_builddir = @top_builddir@
# files and flags
SOURCES:= pdu.c net.c debug.c encode.c uri.c list.c subscribe.c str.c
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
HEADERS:=coap.h config.h debug.h pdu.h net.h encode.h uri.h list.h mem.h subscribe.h str.h
#CFLAGS:=-g -Wall -ansi -pedantic
CFLAGS:=-Wall -ansi -pedantic @CFLAGS@
DISTDIR=$(abs_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
SUBDIRS:=examples
FILES:=Makefile $(SOURCES) $(HEADERS)
LIB:=libcoap.a
LDFLAGS:=@LIBS@
ARFLAGS:=cru
examples:=examples
doc:=doc
.PHONY: all dirs clean distclean .gitignore doc
.SUFFIXES:
.SUFFIXES: .c .o
all: $(LIB) dirs
check:
echo DISTDIR: $(DISTDIR)
echo top_builddir: $(top_builddir)
$(MAKE) -C examples check
dirs: $(SUBDIRS)
for dir in $^; do \
$(MAKE) -C $$dir ; \
done
$(LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $^
ranlib $@
clean:
@rm -f $(PROGRAM) main.o $(LIB) $(OBJECTS)
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean ; \
done
doc:
$(MAKE) -C doc
distclean: clean
@rm -rf $(DISTDIR)
@rm -f *~ $(DISTDIR).tar.gz
dist:
test -d $(DISTDIR) || mkdir $(DISTDIR)
test -d $(DISTDIR)/$(examples) || mkdir $(DISTDIR)/$(examples)
cp $(FILES) $(DISTDIR)
$(MAKE) -C $(examples) dist DISTDIR=../$(DISTDIR)/$(examples)
tar czf $(DISTDIR).tar.gz $(DISTDIR)
.gitignore:
echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@