diff --git a/Makefile b/Makefile index 2b445b42..b4ef4146 100644 --- a/Makefile +++ b/Makefile @@ -53,8 +53,8 @@ EXTRA_LIB_DEPS=$(INCDIR)/api.h $(PATCHED_SDK) ########## Nothing below this line should be edited by typical users ########### -include ./common.mk -.PHONY: $(INCDIR)/api.h patch_sdk_headers clean -$(INCDIR)/api.h: version.py +.PHONY: $(INCDIR)/pros/version.h patch_sdk_headers clean +$(INCDIR)/pros/version.h: version.py $(VV)python version.py patch_sdk_headers: patch_headers.py @@ -62,7 +62,7 @@ patch_sdk_headers: patch_headers.py $(VV)python patch_headers.py # Override clean, necessary to remove patched sdk on clean -clean: +clean:: @echo "Cleaning patched SDK" @rm -f $(PATCHED_SDK) @rm -rf $(EXTRA_INCDIR) diff --git a/common.mk b/common.mk index 39bd7d95..edc623b4 100644 --- a/common.mk +++ b/common.mk @@ -188,7 +188,7 @@ quick: $(DEFAULT_BIN) all: clean $(DEFAULT_BIN) -clean: +clean:: @echo Cleaning project -$Drm -rf $(BINDIR) -$Drm -rf $(DEPDIR) @@ -262,7 +262,7 @@ $(foreach asmext,$(ASMEXTS),$(eval $(call asm_rule,$(asmext)))) define c_rule $(BINDIR)/%.$1.o: $(SRCDIR)/%.$1 -$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1 $(DEPDIR)/$(basename $1).d +$(BINDIR)/%.$1.o: $(SRCDIR)/%.$1 $(DEPDIR)/$(basename %).d $(VV)mkdir -p $$(dir $$@) $(MAKEDEPFOLDER) $$(call test_output_2,Compiled $$< ,$(CC) -c $(INCLUDE) -iquote"$(INCDIR)/$$(dir $$*)" $(CFLAGS) $(EXTRA_CFLAGS) $(DEPFLAGS) -o $$@ $$<,$(OK_STRING)) diff --git a/include/api.h b/include/api.h index 57c248c7..ea328e33 100644 --- a/include/api.h +++ b/include/api.h @@ -39,13 +39,6 @@ #include #endif /* __cplusplus */ -#define PROS_VERSION_MAJOR 4 -#define PROS_VERSION_MINOR 1 - -#define PROS_VERSION_PATCH 0 -#define PROS_VERSION_STRING "4.1.0" - - #include "pros/adi.h" #include "pros/colors.h" #include "pros/device.h" diff --git a/include/pros/version.h b/include/pros/version.h new file mode 100644 index 00000000..453284f6 --- /dev/null +++ b/include/pros/version.h @@ -0,0 +1,23 @@ +/** +* \file version.h +* +* PROS Version Information +* +* Contains PROS kernel version information +* +* +* \copyright Copyright (c) 2017-2023, Purdue University ACM SIGBots. +* All rights reserved. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#pragma once + +#define PROS_VERSION_MAJOR 4 +#define PROS_VERSION_MINOR 1 + +#define PROS_VERSION_PATCH 0 +#define PROS_VERSION_STRING "4.1.0" \ No newline at end of file diff --git a/src/system/dev/ser_daemon.c b/src/system/dev/ser_daemon.c index d77fdee3..86305d95 100644 --- a/src/system/dev/ser_daemon.c +++ b/src/system/dev/ser_daemon.c @@ -18,6 +18,7 @@ #include #include "kapi.h" +#include "pros/version.h" #include "system/dev/banners.h" #include "system/hot.h" #include "system/optimizers.h" diff --git a/version.py b/version.py index e818f25e..7a275939 100644 --- a/version.py +++ b/version.py @@ -28,7 +28,7 @@ assert semver.count('.') >= 2 major, minor, patch = semver.split('.', 2) patch = patch.split('-', 1)[0] - with io.open('include/api.h', 'r', encoding='ascii') as file: + with io.open('include/pros/version.h', 'r', encoding='ascii') as file: data = file.readlines() for i, line in enumerate(data): if '#define PROS_VERSION_MAJOR' in line: @@ -39,7 +39,7 @@ data[i] = u'#define PROS_VERSION_PATCH {}\n'.format(patch) if '#define PROS_VERSION_STRING ' in line: data[i] = u'#define PROS_VERSION_STRING "{}"\n'.format(semver) - with io.open('include/api.h', 'w', newline='\n', encoding='ascii') as file: + with io.open('include/pros/version.h', 'w', newline='\n', encoding='ascii') as file: file.writelines(data) except subprocess.CalledProcessError as e: