Cleanup building header files for different OS

'make distclean' removes header files built from the .in files, which
means that they are not available for different OS builds.

The same is true for CMakeLists.txt.

Remove the need for the .in files and update for libcoap revisions
by using a new script scripts/fix_version.sh created from
scripts/fix_version.sh.in.

CI has been updated to check revisions have been updated in the
appropriate places.

Do not remove libcoap-3.sym and libcoap-3.map when doing 'make distclean'
as they are git tracked files.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-08-06 16:56:19 +01:00
1 parent 9656876b41
commit 83718a6d2f
16 files changed
+41 -2071

No files matched your search

+9 -4
View File
@@ -6,15 +6,20 @@
make update-map-file > /dev/null
#
# Check for any version revision changes
#
. scripts/fix_version.sh
git diff > diff_check
WC=`cat diff_check | wc -l`
if [ $WC != 0 ] ; then
echo
echo "Please update the master file (usually .in) for the following files"
echo "that had the changes reverted by the running of './configure'."
echo "There is no need to update the original files, just commit the"
echo "changed .in files."
echo "Please correct any header files for the appropriate revision"
echo "changes. It is possible to do this by running"
echo " . scripts/fix_version.sh"
echo "and then commit the changes to the header files."
echo
echo "Or run 'make update-map-file' and commit the changes to"
echo "libcoap-3.map and libcoap-3.sym."
+24
View File
@@ -0,0 +1,24 @@
#/bin/sh
FILES="coap_config.h.contiki \
coap_config.h.riot \
coap_config.h.windows \
include/coap@LIBCOAP_API_VERSION@/coap.h.riot \
include/coap@LIBCOAP_API_VERSION@/coap.h.windows \
examples/lwip/config/coap_config.h"
for file in $FILES ; do
sed -i $file -e 's/#define PACKAGE_NAME ".*"/#define PACKAGE_NAME "@PACKAGE_NAME@"/g'
sed -i $file -e 's/#define PACKAGE_STRING ".*"/#define PACKAGE_STRING "@PACKAGE_STRING@"/g'
sed -i $file -e 's/#define PACKAGE_VERSION ".*"/#define PACKAGE_VERSION "@PACKAGE_VERSION@"/g'
sed -i $file -e 's/#define PACKAGE_TARNAME ".*"/#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"/g'
sed -i $file -e 's/#define LIBCOAP_VERSION (.*)/#define LIBCOAP_VERSION (@LIBCOAP_VERSION@U)/g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_STRING ".*"/#define LIBCOAP_PACKAGE_STRING "@PACKAGE_STRING@"/g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_VERSION ".*"/#define LIBCOAP_PACKAGE_VERSION "@PACKAGE_VERSION@"/g'
done
for file in CMakeLists.txt ; do
sed -i $file -e 's/^ VERSION .*$/ VERSION @LIBCOAP_PACKAGE_BASE@/g'
sed -i $file -e 's/set(LIBCOAP_API_VERSION .*)$/set(LIBCOAP_API_VERSION @LIBCOAP_API_VERSION@)/g'
sed -i $file -e 's/set(LIBCOAP_ABI_VERSION .*)$/set(LIBCOAP_ABI_VERSION @LIBCOAP_ABI_VERSION@)/g'
done