Demo static lib
This commit is contained in:
		
							parent
							
								
									ea34f7635b
								
							
						
					
					
						commit
						0eb4680c48
					
				
					 5 changed files with 51 additions and 3 deletions
				
			
		
							
								
								
									
										11
									
								
								makefile
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								makefile
									
										
									
									
									
								
							|  | @ -1,4 +1,4 @@ | |||
| # Compiler and assembler
 | ||||
| #dd Compiler and assembler
 | ||||
| CC = 		gcc | ||||
| AS = 		as | ||||
| LD = 		ld | ||||
|  | @ -20,6 +20,7 @@ CFLAGS += -Wno-unused-local-typedefs | |||
| CFLAGS += -Wno-unused-const-variable | ||||
| CFLAGS += -Wno-unused-macros | ||||
| CFLAGS += -O3 | ||||
| CFLAGS += -Ilibadd/include | ||||
| CFLAGS += -g | ||||
| 
 | ||||
| GITHASH = $(shell git rev-parse --short HEAD) | ||||
|  | @ -36,6 +37,9 @@ OBJS := $(patsubst src/%.c,build/%.o,$(SRCS)) | |||
| 
 | ||||
| all: $(TARGET) | ||||
| 
 | ||||
| libadd/libadd.a: | ||||
| 	$(MAKE) -C libadd | ||||
| 
 | ||||
| # For convenience
 | ||||
| run: $(TARGET) | ||||
| 	@./$(TARGET) | ||||
|  | @ -45,7 +49,7 @@ mkbuilddir: | |||
| 	@mkdir -p build | ||||
| 
 | ||||
| # Link the object files into the target binary
 | ||||
| $(TARGET): $(OBJS) | ||||
| $(TARGET): $(OBJS) libadd/libadd.a | ||||
| 	@$(CC) $(CFLAGS) -o $@ $^ | ||||
| 	@echo -e "LD \t$^" | ||||
| 
 | ||||
|  | @ -67,6 +71,7 @@ clean: | |||
| 	rm -r build | ||||
| 	rm -f build/*.o | ||||
| 	rm -f $(TARGET)* | ||||
| 	$(MAKE) -C libadd clean --no-print-directory | ||||
| 
 | ||||
| # Create a signed release
 | ||||
| tar: $(TARGET_TAR) | ||||
|  | @ -81,4 +86,4 @@ $(TARGET_TAR): $(TARGET) | |||
| 	strip $< | ||||
| 	tar --zstd -cvf $@ $< | ||||
| 
 | ||||
| .PHONY: all clean size mkbuilddir run tar sign | ||||
| .PHONY: all clean size mkbuilddir run tar sign | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus