update makefile to be able to define a target platform prefix
This commit is contained in:
		
							parent
							
								
									e5e8cc2e50
								
							
						
					
					
						commit
						d0a83df7f8
					
				
							
								
								
									
										15
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								makefile
									
									
									
									
									
								
							@ -9,8 +9,13 @@ VERSION=1.17
 | 
				
			|||||||
PLATFORM := $(shell uname | sed -e 's/_.*//')
 | 
					PLATFORM := $(shell uname | sed -e 's/_.*//')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Compiler and Linker Names
 | 
					# Compiler and Linker Names
 | 
				
			||||||
#CC=gcc
 | 
					ifndef PREFIX
 | 
				
			||||||
#LD=ld
 | 
					  PREFIX=
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CC=$(PREFIX)gcc
 | 
				
			||||||
 | 
					LD=$(PREFIX)ld
 | 
				
			||||||
 | 
					AR=$(PREFIX)ar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Archiver [makes .a files]
 | 
					# Archiver [makes .a files]
 | 
				
			||||||
#AR=ar
 | 
					#AR=ar
 | 
				
			||||||
@ -23,9 +28,9 @@ endif
 | 
				
			|||||||
# ranlib tools
 | 
					# ranlib tools
 | 
				
			||||||
ifndef RANLIB
 | 
					ifndef RANLIB
 | 
				
			||||||
ifeq ($(PLATFORM), Darwin)
 | 
					ifeq ($(PLATFORM), Darwin)
 | 
				
			||||||
RANLIB=ranlib -c
 | 
					RANLIB=$(PREFIX)ranlib -c
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
RANLIB=ranlib
 | 
					RANLIB=$(PREFIX)ranlib
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -274,7 +279,7 @@ library: $(LIBNAME)
 | 
				
			|||||||
$(OBJECTS): $(HEADERS)
 | 
					$(OBJECTS): $(HEADERS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
testprof/$(LIBTEST): 
 | 
					testprof/$(LIBTEST): 
 | 
				
			||||||
	cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) 
 | 
						cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(LIBNAME): $(OBJECTS)
 | 
					$(LIBNAME): $(OBJECTS)
 | 
				
			||||||
	$(AR) $(ARFLAGS) $@ $(OBJECTS) 
 | 
						$(AR) $(ARFLAGS) $@ $(OBJECTS) 
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user