mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 14:18:20 +08:00 
			
		
		
		
	feat(code/c): add c code Makefile compile method
This commit is contained in:
		
							
								
								
									
										15
									
								
								codes/c/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								codes/c/Makefile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					CXXFLAGS = # -Wall -Werror
 | 
				
			||||||
 | 
					LDFLAGS = 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					src = $(wildcard ./*/*.c)
 | 
				
			||||||
 | 
					target = $(patsubst %.c, %, ${src})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: all clean
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%:%.cpp
 | 
				
			||||||
 | 
						$(CXX) ${CXXFLAGS} ${LDFLAGS} $^ -o $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					all: ${target}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clean:
 | 
				
			||||||
 | 
						rm -f ${target}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user