Skip to content

Commit

Permalink
Pass the version as a macro (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed May 23, 2024
1 parent 7ec80e3 commit 94cbe8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ define TEST_CPPFLAGS
-I $(TEST_DIR)/$(HDR_DIR)
endef
define MCONF_CPPFLAGS
$(DISABLE_ASSERTS_OPTS) \
$(DISABLE_ASSERTS_OPTS) \
-D SK_VERSION=$(DIST_VERSION) \
-I $(TOOLS_DIR)/$(MCONF_NAME)/$(HDR_DIR)
endef
define SKAP_CPPFLAGS
Expand Down
5 changes: 4 additions & 1 deletion tools/mconf/src/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
#include <dialog.h>
#include <sys/ioctl.h>

#define sk_xstr(s) sk_str(s)
#define sk_str(s) #s

#ifndef SK_VERSION
#define SK_VERSION "v0.0-UNDEFINED"
#endif
#define CONFIG_FILE "config.mk"
#define TITLE "Sparky " SK_VERSION " Build Configuration"
#define TITLE "Sparky " sk_xstr(SK_VERSION) " Build Configuration"
#define PADDING_HEIGHT 8
#define PADDING_WIDTH 7

Expand Down

0 comments on commit 94cbe8c

Please sign in to comment.