mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-11-04 07:00:39 +01:00 
			
		
		
		
	Makefile: clean up variables
- replace $(LIBS) by $(LDFLAGS)
- use override to handle CPPFLAGS, CFLAGS, LDFLAGS
    This allows to append flags to the users input.
- remove unused $(DIFF)
Change-Id: I1c9e869377677d624469af1ee9ece9a28fc3b559
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/59230
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Nico Huber
					
				
			
			
				
	
			
			
			
						parent
						
							462a6159ab
						
					
				
				
					commit
					cf947c9f51
				
			
							
								
								
									
										9
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								Makefile
									
									
									
									
									
								
							@@ -28,7 +28,6 @@ PROGRAM = flashrom
 | 
				
			|||||||
STRIP   ?= strip
 | 
					STRIP   ?= strip
 | 
				
			||||||
STRIP_ARGS = -s
 | 
					STRIP_ARGS = -s
 | 
				
			||||||
INSTALL = install
 | 
					INSTALL = install
 | 
				
			||||||
DIFF    = diff
 | 
					 | 
				
			||||||
PREFIX  ?= /usr/local
 | 
					PREFIX  ?= /usr/local
 | 
				
			||||||
MANDIR  ?= $(PREFIX)/share/man
 | 
					MANDIR  ?= $(PREFIX)/share/man
 | 
				
			||||||
CFLAGS  ?= -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings
 | 
					CFLAGS  ?= -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings
 | 
				
			||||||
@@ -263,7 +262,7 @@ ifeq ($(TARGET_OS), DOS)
 | 
				
			|||||||
EXEC_SUFFIX := .exe
 | 
					EXEC_SUFFIX := .exe
 | 
				
			||||||
# DJGPP has odd uint*_t definitions which cause lots of format string warnings.
 | 
					# DJGPP has odd uint*_t definitions which cause lots of format string warnings.
 | 
				
			||||||
override CFLAGS += -Wno-format
 | 
					override CFLAGS += -Wno-format
 | 
				
			||||||
LIBS += -lgetopt
 | 
					override LDFLAGS += -lgetopt
 | 
				
			||||||
# Missing serial support.
 | 
					# Missing serial support.
 | 
				
			||||||
$(call mark_unsupported,$(DEPENDS_ON_SERIAL))
 | 
					$(call mark_unsupported,$(DEPENDS_ON_SERIAL))
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
@@ -815,7 +814,7 @@ endif
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
ifneq ($(NEED_POSIX_SOCKETS), )
 | 
					ifneq ($(NEED_POSIX_SOCKETS), )
 | 
				
			||||||
ifeq ($(TARGET_OS), SunOS)
 | 
					ifeq ($(TARGET_OS), SunOS)
 | 
				
			||||||
LIBS += -lsocket -lnsl
 | 
					override LDFLAGS += -lsocket -lnsl
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -894,7 +893,7 @@ endif
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
ifeq ($(HAS_CLOCK_GETTIME), yes)
 | 
					ifeq ($(HAS_CLOCK_GETTIME), yes)
 | 
				
			||||||
FEATURE_CFLAGS += -D'HAVE_CLOCK_GETTIME=1'
 | 
					FEATURE_CFLAGS += -D'HAVE_CLOCK_GETTIME=1'
 | 
				
			||||||
FEATURE_LIBS += -lrt
 | 
					override LDFLAGS += -lrt
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
 | 
					LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
 | 
				
			||||||
@@ -906,7 +905,7 @@ ifeq ($(ARCH), x86)
 | 
				
			|||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
 | 
					$(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
 | 
				
			||||||
	$(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LDFLAGS) $(LIBS) $(FEATURE_LIBS)
 | 
						$(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LDFLAGS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
libflashrom.a: $(LIBFLASHROM_OBJS)
 | 
					libflashrom.a: $(LIBFLASHROM_OBJS)
 | 
				
			||||||
	$(AR) rcs $@ $^
 | 
						$(AR) rcs $@ $^
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user