version-rework #52
							
								
								
									
										15
									
								
								stm-firmware/create_version_header.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								stm-firmware/create_version_header.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ -z $1 ]]; then
 | 
				
			||||||
 | 
						# Exit with error in case no output file is specified
 | 
				
			||||||
 | 
						exit -1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					firmware_version=`git describe --tags --always --dirty`
 | 
				
			||||||
 | 
					commit=`git rev-parse HEAD`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "#ifndef _VERSION_GENERATED_H_" > $1
 | 
				
			||||||
 | 
					echo "#define _VERSION_GENERATED_H_" >> $1
 | 
				
			||||||
 | 
					echo "#define GIT_VERSION_STRING \"$firmware_version\"" >> $1
 | 
				
			||||||
 | 
					echo "#define GIT_FULL_COMMIT \"$commit\"" >> $1
 | 
				
			||||||
 | 
					echo "#endif /* _VERSION_GENERATED_H_ */" >> $1
 | 
				
			||||||
		Reference in New Issue
	
	Block a user