Skip to content

Commit

Permalink
Let configure create the Makefile in examples/contiki.
Browse files Browse the repository at this point in the history
  • Loading branch information
obgm committed Dec 2, 2014
1 parent 58a3d10 commit dc340bb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
16 changes: 9 additions & 7 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ SHELL = /bin/sh
MKDIR = mkdir
ETAGS = @ETAGS@

ifneq ("@WITH_CONTIKI@", "1")
prefix = @prefix@
exec_prefix = @exec_prefix@
abs_builddir = @abs_builddir@
Expand All @@ -55,16 +54,18 @@ HEADERS:=dtls.h hmac.h debug.h dtls_config.h uthash.h numeric.h crypto.h global.
CFLAGS:=-Wall -pedantic -std=c99 @CFLAGS@
CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE
SUBDIRS:=tests doc platform-specific sha2 aes ecc
DISTSUBDIRS:=$(SUBDIRS) examples/contiki
DISTDIR=$(top_builddir)/$(package)
FILES:=Makefile.in configure configure.in dtls_config.h.in tinydtls.h.in \
Makefile.contiki Makefile.tinydtls $(SOURCES) $(HEADERS)
Makefile.tinydtls $(SOURCES) $(HEADERS)
LIB:=libtinydtls.a
LDFLAGS:=@LIBS@
ARFLAGS:=cru
doc:=doc

.PHONY: all dirs clean install dist distclean .gitignore doc TAGS

ifneq ("@WITH_CONTIKI@", "1")
.SUFFIXES:
.SUFFIXES: .c .o

Expand Down Expand Up @@ -92,6 +93,10 @@ clean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean ; \
done
else # WITH_CONTIKI
all:
$(MAKE) -C examples/contiki $@
endif # WITH_CONTIKI

doc:
$(MAKE) -C doc
Expand All @@ -100,10 +105,10 @@ distclean: clean
@rm -rf $(DISTDIR)
@rm -f *~ $(DISTDIR).tar.gz

dist: $(FILES) $(SUBDIRS)
dist: $(FILES) $(DISTSUBDIRS)
test -d $(DISTDIR) || mkdir $(DISTDIR)
cp $(FILES) $(DISTDIR)
for dir in $(SUBDIRS); do \
for dir in $(DISTSUBDIRS); do \
$(MAKE) -C $$dir dist; \
done
tar czf $(package).tar.gz $(DISTDIR)
Expand All @@ -116,9 +121,6 @@ install: $(LIB) $(HEADERS) $(SUBDIRS)
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install="$(install)" includedir=$(includedir) install; \
done
else # WITH_CONTIKI
include Makefile.contiki
endif # WITH_CONTIKI

TAGS:
$(ETAGS) -o $@.new $(SOURCES)
Expand Down
8 changes: 5 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# SOFTWARE.

AC_PREREQ([2.65])
AC_INIT([tinydtls], [0.8.0])
AC_INIT([tinydtls], [0.8.1])
AC_CONFIG_SRCDIR([dtls.c])
dnl AC_CONFIG_HEADERS([config.h])

Expand All @@ -34,13 +34,14 @@ AC_ARG_WITH(contiki,
WITH_CONTIKI=1],
[])

AC_PATH_PROG(DOXYGEN, doxygen, [:])
AC_PATH_PROG(ETAGS, etags, [/bin/false])

if test "${with_contiki}" != "yes" ; then
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_RANLIB
AC_PATH_PROG(DOXYGEN, doxygen, [:])
AC_PATH_PROG(ETAGS, etags, [/bin/false])

AC_C_BIGENDIAN

Expand Down Expand Up @@ -106,6 +107,7 @@ AC_CONFIG_FILES([Makefile
doc/Makefile
doc/Doxyfile
tests/Makefile
examples/contiki/Makefile
platform-specific/Makefile
sha2/Makefile
aes/Makefile
Expand Down
20 changes: 19 additions & 1 deletion examples/contiki/Makefile → examples/contiki/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@ endif
# usually, you should not need changing anything beyond this line
########################################################################

# the library's version
VERSION:=@PACKAGE_VERSION@

# tools
@SET_MAKE@
SHELL = /bin/sh
MKDIR = mkdir

abs_builddir = @abs_builddir@
top_builddir = @top_builddir@
top_srcdir:= @top_srcdir@
DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
DTLS_SOURCES:=dtls-server.c dtls-client.c
FILES:=Makefile.in $(DTLS_SOURCES)

all: dtls-server dtls-client
$(MAKE) $(MAKEFLAGS) ROLE=server dtls-server
$(MAKE) $(MAKEFLAGS) clean
$(MAKE) $(MAKEFLAGS) ROLE=client dtls-client

CONTIKI=../../../..
CONTIKI=$(top_srcdir)/../..

WITH_UIP6=1
UIP_CONF_IPV6=1
Expand All @@ -40,4 +54,8 @@ APPS += tinydtls/aes tinydtls/sha2 tinydtls/ecc tinydtls

ccm-test: tests/ccm-test

dist: $(FILES)
test -d $(DISTDIR)/examples/contiki || $(MKDIR) -p $(DISTDIR)/examples/contiki
cp $(FILES) $(DISTDIR)/examples/contiki

include $(CONTIKI)/Makefile.include

0 comments on commit dc340bb

Please sign in to comment.