"Fossies" - the Fresh Open Source Software Archive

Member "dmidecode-3.3/Makefile" (14 Oct 2020, 3849 Bytes) of package /linux/privat/dmidecode-3.3.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 3.2_vs_3.3.

    1 #
    2 #   DMI Decode
    3 #   BIOS Decode
    4 #   VPD Decode
    5 #
    6 #   Copyright (C) 2000-2002 Alan Cox <alan@redhat.com>
    7 #   Copyright (C) 2002-2020 Jean Delvare <jdelvare@suse.de>
    8 #
    9 #   This program is free software; you can redistribute it and/or modify
   10 #   it under the terms of the GNU General Public License as published by
   11 #   the Free Software Foundation; either version 2 of the License, or
   12 #   (at your option) any later version.
   13 #
   14 
   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 \
   22           -Wcast-align -Wwrite-strings -Wmissing-prototypes -Winline -Wundef
   23 
   24 # Let lseek and mmap support 64-bit wide offsets
   25 CFLAGS += -D_FILE_OFFSET_BITS=64
   26 
   27 #CFLAGS += -DBIGENDIAN
   28 #CFLAGS += -DALIGNMENT_WORKAROUND
   29 
   30 # Pass linker flags here (can be set from environment too)
   31 LDFLAGS ?=
   32 
   33 DESTDIR =
   34 prefix  = /usr/local
   35 sbindir = $(prefix)/sbin
   36 mandir  = $(prefix)/share/man
   37 man8dir = $(mandir)/man8
   38 docdir  = $(prefix)/share/doc/dmidecode
   39 
   40 INSTALL         := install
   41 INSTALL_DATA    := $(INSTALL) -m 644
   42 INSTALL_DIR     := $(INSTALL) -m 755 -d
   43 INSTALL_PROGRAM := $(INSTALL) -m 755
   44 RM              := rm -f
   45 
   46 # BSD make provides $MACHINE, but GNU make doesn't
   47 MACHINE ?= $(shell uname -m 2>/dev/null)
   48 
   49 # These programs are only useful on x86
   50 PROGRAMS-i386 := biosdecode ownership vpddecode
   51 PROGRAMS-i486 := $(PROGRAMS-i386)
   52 PROGRAMS-i586 := $(PROGRAMS-i386)
   53 PROGRAMS-i686 := $(PROGRAMS-i386)
   54 PROGRAMS-x86_64 := biosdecode ownership vpddecode
   55 PROGRAMS-amd64 := $(PROGRAMS-x86_64)
   56 
   57 PROGRAMS := dmidecode $(PROGRAMS-$(MACHINE))
   58 
   59 all : $(PROGRAMS)
   60 
   61 #
   62 # Programs
   63 #
   64 
   65 dmidecode : dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o
   66 	$(CC) $(LDFLAGS) dmidecode.o dmiopt.o dmioem.o dmioutput.o util.o -o $@
   67 
   68 biosdecode : biosdecode.o util.o
   69 	$(CC) $(LDFLAGS) biosdecode.o util.o -o $@
   70 
   71 ownership : ownership.o util.o
   72 	$(CC) $(LDFLAGS) ownership.o util.o -o $@
   73 
   74 vpddecode : vpddecode.o vpdopt.o util.o
   75 	$(CC) $(LDFLAGS) vpddecode.o vpdopt.o util.o -o $@
   76 
   77 #
   78 # Objects
   79 #
   80 
   81 dmidecode.o : dmidecode.c version.h types.h util.h config.h dmidecode.h \
   82 	      dmiopt.h dmioem.h dmioutput.h
   83 	$(CC) $(CFLAGS) -c $< -o $@
   84 
   85 dmiopt.o : dmiopt.c config.h types.h util.h dmidecode.h dmiopt.h
   86 	$(CC) $(CFLAGS) -c $< -o $@
   87 
   88 dmioem.o : dmioem.c types.h dmidecode.h dmioem.h dmioutput.h
   89 	$(CC) $(CFLAGS) -c $< -o $@
   90 
   91 dmioutput.o : dmioutput.c types.h dmioutput.h
   92 	$(CC) $(CFLAGS) -c $< -o $@
   93 
   94 biosdecode.o : biosdecode.c version.h types.h util.h config.h 
   95 	$(CC) $(CFLAGS) -c $< -o $@
   96 
   97 ownership.o : ownership.c version.h types.h util.h config.h
   98 	$(CC) $(CFLAGS) -c $< -o $@
   99 
  100 vpddecode.o : vpddecode.c version.h types.h util.h config.h vpdopt.h
  101 	$(CC) $(CFLAGS) -c $< -o $@
  102 
  103 vpdopt.o : vpdopt.c config.h util.h vpdopt.h
  104 	$(CC) $(CFLAGS) -c $< -o $@
  105 
  106 util.o : util.c types.h util.h config.h
  107 	$(CC) $(CFLAGS) -c $< -o $@
  108 
  109 #
  110 # Commands
  111 #
  112 
  113 strip : $(PROGRAMS)
  114 	strip $(PROGRAMS)
  115 
  116 install : install-bin install-man install-doc
  117 
  118 uninstall : uninstall-bin uninstall-man uninstall-doc
  119 
  120 install-bin : $(PROGRAMS)
  121 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
  122 	for program in $(PROGRAMS) ; do \
  123 	$(INSTALL_PROGRAM) $$program $(DESTDIR)$(sbindir) ; done
  124 
  125 uninstall-bin :
  126 	for program in $(PROGRAMS) ; do \
  127 	$(RM) $(DESTDIR)$(sbindir)/$$program ; done
  128 
  129 install-man :
  130 	$(INSTALL_DIR) $(DESTDIR)$(man8dir)
  131 	for program in $(PROGRAMS) ; do \
  132 	$(INSTALL_DATA) man/$$program.8 $(DESTDIR)$(man8dir) ; done
  133 
  134 uninstall-man :
  135 	for program in $(PROGRAMS) ; do \
  136 	$(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
  137 
  138 install-doc :
  139 	$(INSTALL_DIR) $(DESTDIR)$(docdir)
  140 	$(INSTALL_DATA) README $(DESTDIR)$(docdir)
  141 	$(INSTALL_DATA) NEWS $(DESTDIR)$(docdir)
  142 	$(INSTALL_DATA) AUTHORS $(DESTDIR)$(docdir)
  143 
  144 uninstall-doc :
  145 	$(RM) -r $(DESTDIR)$(docdir)
  146 
  147 clean :
  148 	$(RM) *.o $(PROGRAMS) core