add Makefile to automate build process
This commit is contained in:
		
							parent
							
								
									b47037f66e
								
							
						
					
					
						commit
						9f424ffac9
					
				
							
								
								
									
										20
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
CFLAGS=-O3 -Iinc/
 | 
			
		||||
 | 
			
		||||
build: main
 | 
			
		||||
 | 
			
		||||
out/:
 | 
			
		||||
	mkdir out/
 | 
			
		||||
 | 
			
		||||
main: out/main.o out/swapper.o
 | 
			
		||||
	gcc $(CFLAGS) out/main.o out/swapper.o -o main
 | 
			
		||||
 | 
			
		||||
out/main.o: out/ src/main.c
 | 
			
		||||
	gcc $(CFLAGS) -c src/main.c -o out/main.o
 | 
			
		||||
 | 
			
		||||
out/swapper.o: out/ src/swapper.c
 | 
			
		||||
	gcc $(CFLAGS) -c src/swapper.c -o out/swapper.o
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -r main out/
 | 
			
		||||
 | 
			
		||||
.PHONY: build clean
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user