makefiles: improve a bit
This commit is contained in:
		
							parent
							
								
									80e0862e83
								
							
						
					
					
						commit
						5eb6ebbb23
					
				
							
								
								
									
										18
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								makefile
									
									
									
									
									
								
							| @ -7,22 +7,6 @@ VERSION=0.42.0 | ||||
| 
 | ||||
| include makefile.include | ||||
| 
 | ||||
| # Compiler and Linker Names
 | ||||
| ifndef PREFIX | ||||
|   PREFIX= | ||||
| endif | ||||
| 
 | ||||
| ifeq ($(CC),cc) | ||||
|   CC = $(PREFIX)gcc | ||||
| endif | ||||
| LD=$(PREFIX)ld | ||||
| AR=$(PREFIX)ar | ||||
| RANLIB=$(PREFIX)ranlib | ||||
| 
 | ||||
| ifndef MAKE | ||||
|    MAKE=make | ||||
| endif | ||||
| 
 | ||||
| #install as this user
 | ||||
| ifndef INSTALL_GROUP | ||||
|    GROUP=wheel | ||||
| @ -114,8 +98,6 @@ install: $(LIBNAME) | ||||
| test: $(LIBNAME) demo/demo.o | ||||
| 	$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) -o test | ||||
| 
 | ||||
| test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0 | ||||
| 
 | ||||
| test_standalone: $(LIBNAME) demo/demo.o | ||||
| 	$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) -o test | ||||
| 
 | ||||
|  | ||||
| @ -2,6 +2,22 @@ | ||||
| # Include makefile for libtommath | ||||
| # | ||||
| 
 | ||||
| # Compiler and Linker Names | ||||
| ifndef PREFIX | ||||
|   PREFIX= | ||||
| endif | ||||
| 
 | ||||
| ifeq ($(CC),cc) | ||||
|   CC = $(PREFIX)gcc | ||||
| endif | ||||
| LD=$(PREFIX)ld | ||||
| AR=$(PREFIX)ar | ||||
| RANLIB=$(PREFIX)ranlib | ||||
| 
 | ||||
| ifndef MAKE | ||||
|    MAKE=make | ||||
| endif | ||||
| 
 | ||||
| CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow | ||||
| 
 | ||||
| ifndef NO_ADDTL_WARNINGS | ||||
| @ -30,5 +46,6 @@ endif | ||||
| 
 | ||||
| HEADERS=tommath.h tommath_class.h tommath_superclass.h | ||||
| 
 | ||||
| test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -82,7 +82,11 @@ install: $(LIBNAME) | ||||
| 
 | ||||
| test: $(LIBNAME) demo/demo.o | ||||
| 	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o | ||||
| 	$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME_S) | ||||
| 	$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) | ||||
| 
 | ||||
| test_standalone: $(LIBNAME) demo/demo.o | ||||
| 	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o | ||||
| 	$(LT) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) | ||||
| 
 | ||||
| mtest: | ||||
| 	cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user