changeset 420:070fcb008e63

Improve build system.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Mar 2016 15:10:16 +0200
parents ec109cbaddfb
children d8702bbab84f
files Makefile.inc
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.inc	Wed Mar 09 14:03:10 2016 +0200
+++ b/Makefile.inc	Wed Mar 09 15:10:16 2016 +0200
@@ -6,9 +6,9 @@
 
 .PHONY: clean srcclean all
 
-#
-# Target rules
-#
+##
+## Target rules
+##
 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
 
 
@@ -37,9 +37,20 @@
 	@$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
 	@$(RANLIB) $@
 
-#
-# Special targets
-#
+##
+## Generate endian check and config.h
+##
+$(ENDIANCHK_BIN): $(THLIBS)endianchk.c
+	@echo " CC $@"
+	@$(CC) $(CFLAGS) -o $@ $+
+
+config.h: $(ENDIANCHK_BIN)
+	$(ENDIANCHK_BIN) > $@
+
+
+##
+## Special targets
+##
 clean:
 	$(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o