mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Allow overriding JANETCONF_HEADER in Makefile.
This allows a configuration workflow that is a bit simpler than before and doesn't requiring applying patches. Instead, add a config.mk to source dir with JANETCONF_HEADER=myconfig.h and compile as usual. The patching workflow will of course still work exactly as before.
This commit is contained in:
		| @@ -1,6 +1,9 @@ | ||||
| # Changelog | ||||
| All notable changes to this project will be documented in this file. | ||||
|  | ||||
| ## Unreleased - ??? | ||||
| - Support config.mk for more easily configuring the Makefile. | ||||
|  | ||||
| ## 1.25.0 - 2022-10-10 | ||||
| - Windows FFI fixes. | ||||
| - Fix PEG `if-not` combinator with captures in the condition | ||||
|   | ||||
							
								
								
									
										13
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Makefile
									
									
									
									
									
								
							| @@ -24,6 +24,7 @@ | ||||
| sinclude config.mk | ||||
| PREFIX?=/usr/local | ||||
|  | ||||
| JANETCONF_HEADER?=src/conf/janetconf.h | ||||
| INCLUDEDIR?=$(PREFIX)/include | ||||
| BINDIR?=$(PREFIX)/bin | ||||
| LIBDIR?=$(PREFIX)/lib | ||||
| @@ -83,7 +84,7 @@ all: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.h | ||||
| ##### Name Files ##### | ||||
| ###################### | ||||
|  | ||||
| JANET_HEADERS=src/include/janet.h src/conf/janetconf.h | ||||
| JANET_HEADERS=src/include/janet.h $(JANETCONF_HEADER) | ||||
|  | ||||
| JANET_LOCAL_HEADERS=src/core/features.h \ | ||||
| 					src/core/util.h \ | ||||
| @@ -176,16 +177,16 @@ endif | ||||
| build/c/shell.c: src/mainclient/shell.c | ||||
| 	cp $< $@ | ||||
|  | ||||
| build/janet.h: $(JANET_TARGET) src/include/janet.h src/conf/janetconf.h | ||||
| 	./$(JANET_TARGET) tools/patch-header.janet src/include/janet.h src/conf/janetconf.h $@ | ||||
| build/janet.h: $(JANET_TARGET) src/include/janet.h $(JANETCONF_HEADER) | ||||
| 	./$(JANET_TARGET) tools/patch-header.janet src/include/janet.h $(JANETCONF_HEADER) $@ | ||||
|  | ||||
| build/janetconf.h: src/conf/janetconf.h | ||||
| build/janetconf.h: $(JANETCONF_HEADER) | ||||
| 	cp $< $@ | ||||
|  | ||||
| build/janet.o: build/c/janet.c src/conf/janetconf.h src/include/janet.h | ||||
| build/janet.o: build/c/janet.c $(JANETCONF_HEADER) src/include/janet.h | ||||
| 	$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ | ||||
|  | ||||
| build/shell.o: build/c/shell.c src/conf/janetconf.h src/include/janet.h | ||||
| build/shell.o: build/c/shell.c $(JANETCONF_HEADER) src/include/janet.h | ||||
| 	$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ | ||||
|  | ||||
| $(JANET_TARGET): build/janet.o build/shell.o | ||||
|   | ||||
| @@ -20,7 +20,7 @@ | ||||
|  | ||||
| project('janet', 'c', | ||||
|   default_options : ['c_std=c99', 'build.c_std=c99', 'b_lundef=false', 'default_library=both'], | ||||
|   version : '1.25.0') | ||||
|   version : '1.25.1') | ||||
|  | ||||
| # Global settings | ||||
| janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet') | ||||
|   | ||||
| @@ -5,9 +5,9 @@ | ||||
|  | ||||
| #define JANET_VERSION_MAJOR 1 | ||||
| #define JANET_VERSION_MINOR 25 | ||||
| #define JANET_VERSION_PATCH 0 | ||||
| #define JANET_VERSION_EXTRA "" | ||||
| #define JANET_VERSION "1.25.0" | ||||
| #define JANET_VERSION_PATCH 1 | ||||
| #define JANET_VERSION_EXTRA "-dev" | ||||
| #define JANET_VERSION "1.25.1-dev" | ||||
|  | ||||
| /* #define JANET_BUILD "local" */ | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose