Makefile compiles all asm files
This commit is contained in:
		
							parent
							
								
									285b54e95f
								
							
						
					
					
						commit
						6ad9f66bc7
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1 +1,2 @@ | ||||
| /decode | ||||
| /.idea/ | ||||
|  | ||||
							
								
								
									
										15
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,15 +1,24 @@ | ||||
| CFLAGS=-g -std=c2x -fsanitize=address -fno-omit-frame-pointer -Wall -Wextra -pedantic -O0 | ||||
| CC=gcc | ||||
| #This will get the names of the .asm files
 | ||||
| asm_files = $(wildcard asm_files/*.asm) | ||||
| #This will convert them to .bin names
 | ||||
| bin_files = $(patsubst %.asm,%.bin,$(asm_files)) | ||||
| 
 | ||||
| .PHONY: build clean run all | ||||
| .PHONY: build clean run all asm_files | ||||
| 
 | ||||
| all: decode | ||||
| all: decode asm_files | ||||
| 
 | ||||
| decode: decode.c | ||||
| 	$(CC) $(CFLAGS) $< -o $@ | ||||
| 
 | ||||
| asm_files: $(bin_files) | ||||
| %.bin: %.asm | ||||
| 	nasm $< -o $@ | ||||
| 
 | ||||
| run: all | ||||
| 	./decode | ||||
| 
 | ||||
| clean: | ||||
| 	rm -vf *.so *.o decode | ||||
| 	rm -vf *.so *.o decode $(bin_files) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user