44# VPD Decode
55#
66# Copyright (C) 2000-2002 Alan Cox <[email protected] >7- # Copyright (C) 2002-2015 Jean Delvare <[email protected] >7+ # Copyright (C) 2002-2020 Jean Delvare <[email protected] >88#
99# This program is free software; you can redistribute it and/or modify
1010# it under the terms of the GNU General Public License as published by
1111# the Free Software Foundation; either version 2 of the License, or
1212# (at your option) any later version.
1313#
1414
15- CC = gcc
16- CFLAGS = -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \
15+ CC ?= gcc
16+ # Base CFLAGS can be overridden by environment
17+ CFLAGS ?= -O2
18+ # When debugging, disable -O2 and enable -g
19+ # CFLAGS ?= -g
20+
21+ CFLAGS += -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \
1722 -Wcast-align -Wwrite-strings -Wmissing-prototypes -Winline -Wundef
1823
1924# Let lseek and mmap support 64-bit wide offsets
@@ -22,12 +27,8 @@ CFLAGS += -D_FILE_OFFSET_BITS=64
2227# CFLAGS += -DBIGENDIAN
2328# CFLAGS += -DALIGNMENT_WORKAROUND
2429
25- # When debugging, disable -O2 and enable -g.
26- CFLAGS += -O2
27- # CFLAGS += -g
28-
29- # Pass linker flags here
30- LDFLAGS =
30+ # Pass linker flags here (can be set from environment too)
31+ LDFLAGS ?=
3132
3233UNAME_S := $(shell uname -s)
3334ifeq ($(UNAME_S ) ,Darwin)
@@ -67,8 +68,8 @@ all : $(PROGRAMS)
6768# Programs
6869#
6970
70- dmidecode : dmidecode.o dmiopt.o dmioem.o util.o
71- $(CC ) $(LDFLAGS ) dmidecode.o dmiopt.o dmioem.o util.o -o $@
71+ dmidecode : dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o
72+ $(CC ) $(LDFLAGS ) dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o -o $@
7273
7374biosdecode : biosdecode.o util.o
7475 $(CC ) $(LDFLAGS ) biosdecode.o util.o -o $@
@@ -84,13 +85,16 @@ vpddecode : vpddecode.o vpdopt.o util.o
8485#
8586
8687dmidecode.o : dmidecode.c version.h types.h util.h config.h dmidecode.h \
87- dmiopt.h dmioem.h
88+ dmiopt.h dmioem.h dmioutput.h
8889 $(CC ) $(CFLAGS ) -c $< -o $@
8990
9091dmiopt.o : dmiopt.c config.h types.h util.h dmidecode.h dmiopt.h
9192 $(CC ) $(CFLAGS ) -c $< -o $@
9293
93- dmioem.o : dmioem.c types.h dmidecode.h dmioem.h
94+ dmioem.o : dmioem.c types.h dmidecode.h dmioem.h dmioutput.h
95+ $(CC ) $(CFLAGS ) -c $< -o $@
96+
97+ dmioutput.o : dmioutput.c types.h dmioutput.h
9498 $(CC ) $(CFLAGS ) -c $< -o $@
9599
96100biosdecode.o : biosdecode.c version.h types.h util.h config.h
0 commit comments