fix example path
This commit is contained in:
		
							parent
							
								
									65a26a9110
								
							
						
					
					
						commit
						3c8eafecfb
					
				
					 1 changed files with 34 additions and 0 deletions
				
			
		
							
								
								
									
										34
									
								
								examples/lang_c/Makefile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								examples/lang_c/Makefile
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | ||||||
|  | CC := gcc | ||||||
|  | 
 | ||||||
|  | THIS_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||||||
|  | REPO_ROOT := $(THIS_DIR)/../../ | ||||||
|  | 
 | ||||||
|  | build: out/lang_c | ||||||
|  | 
 | ||||||
|  | clean: | ||||||
|  | 	rm -r out || true | ||||||
|  | 	rm include/servicepoint.h || true | ||||||
|  | 	cargo clean | ||||||
|  | 
 | ||||||
|  | run: out/lang_c | ||||||
|  | 	out/lang_c | ||||||
|  | 
 | ||||||
|  | PHONY: build clean dependencies run | ||||||
|  | 
 | ||||||
|  | out/lang_c: dependencies src/main.c | ||||||
|  | 	mkdir -p out || true | ||||||
|  | 	${CC} src/main.c \
 | ||||||
|  | 		-I include \
 | ||||||
|  | 		-L $(REPO_ROOT)/target/release \
 | ||||||
|  | 		-Wl,-Bstatic -lservicepoint_binding_c \
 | ||||||
|  | 		-Wl,-Bdynamic -llzma \
 | ||||||
|  | 		-o out/lang_c | ||||||
|  | 
 | ||||||
|  | dependencies: FORCE | ||||||
|  | 	mkdir -p include || true | ||||||
|  | 	# generate servicepoint header and binary to link against | ||||||
|  | 	SERVICEPOINT_HEADER_OUT=$(THIS_DIR)/include cargo build \
 | ||||||
|  | 		--manifest-path=$(REPO_ROOT)/Cargo.toml \
 | ||||||
|  | 		--release | ||||||
|  | 
 | ||||||
|  | FORCE: ; | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vinzenz Schroeter
						Vinzenz Schroeter