diff options
author | Alex <colomar.6.4.3@gmail.com> | 2018-12-28 15:05:06 +0100 |
---|---|---|
committer | Alex <colomar.6.4.3@gmail.com> | 2018-12-28 15:05:06 +0100 |
commit | 83109b3aad104255cc7c39b66f6712ad17dfc9bc (patch) | |
tree | ee52a05893287dbca3aaf7e0de0f44b6a8daab3e | |
parent | fb985fd253b5f346614b43cc9965bb5bcc24ef4f (diff) | |
parent | b4a043342d010109840039f39ee31b95a551056d (diff) |
Merge branch 'master' into lighter
-rw-r--r-- | Makefile | 62 | ||||
-rw-r--r-- | modules/Makefile | 29 | ||||
-rw-r--r-- | modules/ctrl/Makefile | 16 | ||||
-rw-r--r-- | modules/ctrl/src/start.c | 1 | ||||
-rw-r--r-- | modules/ctrl/tmp/Makefile | 15 | ||||
-rw-r--r-- | modules/image/inc/img_cv.hpp | 2 | ||||
-rw-r--r-- | modules/image/inc/img_iface.h | 13 | ||||
-rw-r--r-- | modules/image/inc/img_iface.hpp | 9 | ||||
-rw-r--r-- | modules/image/src/img_iface.cpp | 9 | ||||
-rw-r--r-- | modules/image/src/img_ocr.c | 1 | ||||
-rw-r--r-- | modules/image/src/img_zbar.cpp | 1 | ||||
-rw-r--r-- | modules/image/tmp/Makefile | 19 | ||||
-rw-r--r-- | modules/menu/src/menu_tui.c | 1 | ||||
-rw-r--r-- | modules/proc/src/proc_common.cpp | 1 | ||||
-rw-r--r-- | tmp/Makefile | 11 |
15 files changed, 133 insertions, 57 deletions
@@ -207,73 +207,75 @@ export BIN_NAME # That's the default target when none is given on the command line PHONY := all -all: binary +all: libalx modules main binary PHONY += libalx libalx: - @echo ' MAKE libalx-base' - $(Q)make base -C $(LIBALX_DIR) - @echo ' MAKE libalx-io' - $(Q)make io -C $(LIBALX_DIR) - @echo ' MAKE libalx-curses' - $(Q)make curses -C $(LIBALX_DIR) + @echo ' MAKE libalx' + $(Q)$(MAKE) base -C $(LIBALX_DIR) + $(Q)$(MAKE) io -C $(LIBALX_DIR) + $(Q)$(MAKE) curses -C $(LIBALX_DIR) PHONY += modules modules: libalx @echo ' MAKE modules' - $(Q)make -C $(MODULES_DIR) + $(Q)$(MAKE) -C $(MODULES_DIR) -PHONY += object -object: modules libalx - @echo ' MAKE objects' - $(Q)make -C $(TMP_DIR) +PHONY += main +main: modules libalx + @echo ' MAKE main' + $(Q)$(MAKE) -C $(TMP_DIR) PHONY += binary -binary: object +binary: main @echo ' MAKE binary' - $(Q)make -C $(BIN_DIR) + $(Q)$(MAKE) -C $(BIN_DIR) PHONY += install install: uninstall - @echo " Install:" - @echo " MKDIR $(INSTALL_BIN_DIR)/" + @echo " Install:" + @echo " MKDIR $(INSTALL_BIN_DIR)/" $(Q)mkdir -p $(DESTDIR)/$(INSTALL_BIN_DIR)/ @echo " CP $(BIN_NAME)" $(Q)cp $(BIN_DIR)/$(BIN_NAME) $(DESTDIR)/$(INSTALL_BIN_DIR)/ - @echo " MKDIR $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/" + @echo " MKDIR $(INSTALL_SHARE_DIR)/$(SHARE_DIR)/" $(Q)mkdir -p $(DESTDIR)/$(INSTALL_SHARE_DIR)/$(SHARE_DIR)/ @echo " CP -r share/*" $(Q)cp -r ./share/* $(DESTDIR)/$(INSTALL_SHARE_DIR)/$(SHARE_DIR)/ - @echo " Done" - @echo "" + @echo " Done" + @echo PHONY += uninstall uninstall: - @echo " Clean old installations:" + @echo " Clean old installations:" @echo ' RM binary' $(Q)rm -f $(DESTDIR)/$(INSTALL_BIN_DIR)/$(BIN_NAME) @echo ' RM share/*' $(Q)rm -f -r $(DESTDIR)/$(INSTALL_SHARE_DIR)/$(SHARE_DIR)/ - @echo " Done" - @echo "" + @echo " Done" + @echo PHONY += clean clean: - @echo ' CLEAN libalx' - $(Q)make clean -C $(LIBALX_DIR) @echo ' CLEAN modules' - $(Q)make clean -C $(MODULES_DIR) + $(Q)$(MAKE) clean -C $(MODULES_DIR) @echo ' CLEAN tmp' - $(Q)make clean -C $(TMP_DIR) + $(Q)$(MAKE) clean -C $(TMP_DIR) @echo ' CLEAN bin' - $(Q)make clean -C $(BIN_DIR) + $(Q)$(MAKE) clean -C $(BIN_DIR) + +PHONY += mrproper +mrproper: clean + @echo ' CLEAN libalx' + $(Q)$(MAKE) clean -C $(LIBALX_DIR) PHONY += help help: @echo 'Cleaning targets:' @echo ' clean - Remove all generated files' - @echo '' + @echo ' mrproper - Remove all generated files (including libraries)' + @echo @echo 'Other generic targets:' @echo ' all - Build all targets marked with [*]' @echo '* libalx - Build the libalx library' @@ -282,9 +284,9 @@ help: @echo '* binary - Build the binary' @echo ' install - Install the program into the filesystem' @echo ' uninstall - Uninstall the program off the filesystem' - @echo '' + @echo @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' - @echo '' + @echo @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file' diff --git a/modules/Makefile b/modules/Makefile index e3169fc..2e41afa 100644 --- a/modules/Makefile +++ b/modules/Makefile @@ -28,31 +28,40 @@ export USR_DIR # target: dependencies # action +PHONY := all all: @echo ' MAKE modules: about' - $(Q)make -C $(ABOUT_DIR) + $(Q)$(MAKE) -C $(ABOUT_DIR) @echo ' MAKE modules: ctrl' - $(Q)make -C $(CTRL_DIR) + $(Q)$(MAKE) -C $(CTRL_DIR) @echo ' MAKE modules: image' - $(Q)make -C $(IMG_DIR) + $(Q)$(MAKE) -C $(IMG_DIR) @echo ' MAKE modules: menu' - $(Q)make -C $(MENU_DIR) + $(Q)$(MAKE) -C $(MENU_DIR) @echo ' MAKE modules: proc' - $(Q)make -C $(PROC_DIR) + $(Q)$(MAKE) -C $(PROC_DIR) @echo ' MAKE modules: save' - $(Q)make -C $(SAVE_DIR) + $(Q)$(MAKE) -C $(SAVE_DIR) @echo ' MAKE modules: usr' - $(Q)make -C $(USR_DIR) + $(Q)$(MAKE) -C $(USR_DIR) @echo ' MAKE modules.o' - $(Q)make -C $(TMP_DIR) - @echo "" + $(Q)$(MAKE) -C $(TMP_DIR) + @echo +PHONY += clean clean: - @echo " RM *.o *.s" + @echo " RM *.o *.s" $(Q)find . -type f -name '*.o' -exec rm '{}' '+' $(Q)find . -type f -name '*.s' -exec rm '{}' '+' ################################################################################ +# Declare the contents of the .PHONY variable as phony. +.PHONY: $(PHONY) + + + + +################################################################################ ######## End of file ########################################################### ################################################################################ diff --git a/modules/ctrl/Makefile b/modules/ctrl/Makefile index 60d7283..966cac1 100644 --- a/modules/ctrl/Makefile +++ b/modules/ctrl/Makefile @@ -9,16 +9,22 @@ TMP_DIR = $(CTRL_DIR)/tmp/ # target: dependencies # action +PHONY := all all: - $(Q)cd $(TMP_DIR) && $(MAKE) && cd .. + $(Q)$(MAKE) -C $(TMP_DIR) + +PHONY += clean clean: - $(Q)cd $(TMP_DIR) && $(MAKE) clean && cd .. + $(Q)$(MAKE) clean -C $(TMP_DIR) ################################################################################ -######## End of file ########################################################### -################################################################################ -######## End of file ########################################################### +# Declare the contents of the .PHONY variable as phony. +.PHONY: $(PHONY) + + + + ################################################################################ ######## End of file ########################################################### ################################################################################ diff --git a/modules/ctrl/src/start.c b/modules/ctrl/src/start.c index 2a4c18f..bd801c1 100644 --- a/modules/ctrl/src/start.c +++ b/modules/ctrl/src/start.c @@ -9,6 +9,7 @@ /* Standard C ----------------------------------------------------------------*/
/* errno */
#include <errno.h>
+ #include <stddef.h>
/* printf() */
#include <stdio.h>
diff --git a/modules/ctrl/tmp/Makefile b/modules/ctrl/tmp/Makefile index c02411f..4859f7c 100644 --- a/modules/ctrl/tmp/Makefile +++ b/modules/ctrl/tmp/Makefile @@ -37,8 +37,9 @@ STRT_INC_DIRS = -I $(INC_DIR) \ # target: dependencies # action +PHONY := all all: $(ALL) - + ctrl_mod.o: $(_ALL) $(Q)$(LD) -r $^ -o $@ @@ -53,5 +54,17 @@ start.o: start.s @echo " AS $@" +PHONY += clean clean: $(Q)rm -f *.o *.s + +################################################################################ +# Declare the contents of the .PHONY variable as phony. +.PHONY: $(PHONY) + + + + +################################################################################ +######## End of file ########################################################### +################################################################################ diff --git a/modules/image/inc/img_cv.hpp b/modules/image/inc/img_cv.hpp index 31c121f..86ba2a6 100644 --- a/modules/image/inc/img_cv.hpp +++ b/modules/image/inc/img_cv.hpp @@ -13,7 +13,7 @@ /******************************************************************************
******* headers **************************************************************
******************************************************************************/
- /* openCV */
+/* packages ------------------------------------------------------------------*/
#include <opencv2/opencv.hpp>
diff --git a/modules/image/inc/img_iface.h b/modules/image/inc/img_iface.h index 3e5704c..39a1fcc 100644 --- a/modules/image/inc/img_iface.h +++ b/modules/image/inc/img_iface.h @@ -11,6 +11,13 @@ /******************************************************************************
+ ******* headers **************************************************************
+ ******************************************************************************/
+/* Standard C ----------------------------------------------------------------*/
+ #include <stddef.h>
+
+
+/******************************************************************************
******* macros ***************************************************************
******************************************************************************/
/* Constants -----------------------------------------------------------------*/
@@ -22,7 +29,10 @@ # define IMG_IFACE_THR_OTSU (-1)
/* Functions -----------------------------------------------------------------*/
- # define img_iface_act_nodata(x) img_iface_act(x, NULL);
+ # define img_iface_act_nodata(x) \
+ do { \
+ img_iface_act(x, NULL); \
+ } while (0)
/******************************************************************************
@@ -158,7 +168,6 @@ void img_iface_cleanup_main (void);
void img_iface_load (const char *fpath, const char *fname);
void img_iface_cleanup (void);
- /* data should *always* be NULL */
void img_iface_act (int action, void *data);
void img_iface_show_img (void);
void img_iface_show_hist_c1 (void);
diff --git a/modules/image/inc/img_iface.hpp b/modules/image/inc/img_iface.hpp index 7e7002b..5f2109e 100644 --- a/modules/image/inc/img_iface.hpp +++ b/modules/image/inc/img_iface.hpp @@ -13,6 +13,9 @@ /******************************************************************************
******* headers **************************************************************
******************************************************************************/
+/* Standard C ----------------------------------------------------------------*/
+ #include <cstddef>
+
/* Standard C++ --------------------------------------------------------------*/
/* class std::vector */
#include <vector>
@@ -34,6 +37,12 @@ # define IMG_IFACE_THR_OTSU (-1)
+/* Functions -----------------------------------------------------------------*/
+ # define img_iface_act_nodata(x) \
+ do { \
+ img_iface_act(x, NULL); \
+ } while (0)
+
/******************************************************************************
******* enums ****************************************************************
diff --git a/modules/image/src/img_iface.cpp b/modules/image/src/img_iface.cpp index 9cc3760..51723f3 100644 --- a/modules/image/src/img_iface.cpp +++ b/modules/image/src/img_iface.cpp @@ -6,18 +6,19 @@ /******************************************************************************
******* headers **************************************************************
******************************************************************************/
-/* Standard C++ --------------------------------------------------------------*/
- /* class std::vector */
- #include <vector>
-
/* Standard C ----------------------------------------------------------------*/
/* errno */
#include <cerrno>
/* INFINITY */
#include <cmath>
+ #include <cstddef>
/* snprintf() */
#include <cstdio>
+/* Standard C++ --------------------------------------------------------------*/
+ /* class std::vector */
+ #include <vector>
+
/* Packages ------------------------------------------------------------------*/
/* openCV */
#include <opencv2/opencv.hpp>
diff --git a/modules/image/src/img_ocr.c b/modules/image/src/img_ocr.c index a4d2e91..5aba51e 100644 --- a/modules/image/src/img_ocr.c +++ b/modules/image/src/img_ocr.c @@ -9,6 +9,7 @@ /* Standard C ----------------------------------------------------------------*/
/* INT_MAX */
#include <limits.h>
+ #include <stddef.h>
/* snprintf() & FILENAME_MAX */
#include <stdio.h>
diff --git a/modules/image/src/img_zbar.cpp b/modules/image/src/img_zbar.cpp index 1c9b412..083093b 100644 --- a/modules/image/src/img_zbar.cpp +++ b/modules/image/src/img_zbar.cpp @@ -9,6 +9,7 @@ /* Standard C ----------------------------------------------------------------*/
/* INT_MAX */
#include <climits>
+ #include <cstddef>
/* snprintf() */
#include <cstdio>
diff --git a/modules/image/tmp/Makefile b/modules/image/tmp/Makefile index e41df65..e3fba87 100644 --- a/modules/image/tmp/Makefile +++ b/modules/image/tmp/Makefile @@ -70,8 +70,9 @@ IMGI_INC_DIRS = -I $(INC_DIR) \ # target: dependencies # action +PHONY := all all: $(ALL) - + img_mod.o: $(_ALL) $(Q)$(LD) -r $^ -o $@ @@ -127,6 +128,22 @@ img_iface.o: img_iface.s $(Q)$(AS) $< -o $@ @echo " AS $@" + +PHONY += clean +clean: + $(Q)rm -f *.o *.s + +################################################################################ +# Declare the contents of the .PHONY variable as phony. +.PHONY: $(PHONY) + + + + +################################################################################ +######## End of file ########################################################### +################################################################################ + ################################################################################ ######## End of file ########################################################### ################################################################################ diff --git a/modules/menu/src/menu_tui.c b/modules/menu/src/menu_tui.c index e8ba5ce..2ecd173 100644 --- a/modules/menu/src/menu_tui.c +++ b/modules/menu/src/menu_tui.c @@ -9,6 +9,7 @@ /* Standard C ----------------------------------------------------------------*/
#include <ncurses.h>
#include <stdbool.h>
+ #include <stddef.h>
/* libalx --------------------------------------------------------------------*/
#include "alx_ncur.h"
diff --git a/modules/proc/src/proc_common.cpp b/modules/proc/src/proc_common.cpp index 7f92e9b..692cbe7 100644 --- a/modules/proc/src/proc_common.cpp +++ b/modules/proc/src/proc_common.cpp @@ -7,6 +7,7 @@ ******* headers **************************************************************
******************************************************************************/
/* Standard C ----------------------------------------------------------------*/
+ #include <cstddef>
/* snprintf() & fflush() */
#include <cstdio>
/* clock_t & clock() & CLOCKS_PER_SEC */
diff --git a/tmp/Makefile b/tmp/Makefile index 25df3b9..4755930 100644 --- a/tmp/Makefile +++ b/tmp/Makefile @@ -54,6 +54,7 @@ MAIN_INC_DIRS = -I $(LIBALX_INC_DIR) \ # target: dependencies # action +PHONY := all all: $(ALL) main.s: $(MAIN_DEPS) @@ -65,14 +66,18 @@ main.o: main.s @echo "" +PHONY += clean clean: @echo " RM *.o *.s" $(Q)rm -f *.o *.s ################################################################################ -######## End of file ########################################################### -################################################################################ -######## End of file ########################################################### +# Declare the contents of the .PHONY variable as phony. +.PHONY: $(PHONY) + + + + ################################################################################ ######## End of file ########################################################### ################################################################################ |