2
# vim:noet:ai:ts=8:sw=8:filetype=make:nocindent:textwidth=0:
4
# Copyright (C) 2005 Dell Inc.
5
# by Michael Brown <Michael_E_Brown@dell.com>
6
# Licensed under the Open Software License version 2.1
8
# Alternatively, you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published
10
# by the Free Software Foundation; either version 2 of the License,
11
# or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
# See the GNU General Public License for more details.
18
# Note that all 'module.mk' files are "include"-ed in this file and
19
# fall under the same license.
21
# This is a standard non-recursive make system.
25
RELEASE_VERSION := $(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL)
26
RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_VERSION)
29
BUILD_DATE := $(shell date "+%Y-%m-%d %H:%M:%S")
31
#Standard Compiler Flags
32
# To pass in extra args to CFLAGS, CXXFLAGS, or LDFLAGS, use the EXTRA_*
33
# versions from make's command line (see below)
34
CXXFLAGS += -DBUILD_DATE="$(BUILD_DATE)" -g -Wall -W -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
35
CFLAGS += -DBUILD_DATE="$(BUILD_DATE)" -g -Wall -W -Wbad-function-cast -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
36
LDFLAGS += -Llib/ $(EXTRA_LDFLAGS)
38
WARNINGS=-Wpointer-arith -Wfloat-equal -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Winline
39
WARNINGS_CXX=-Wabi -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Woverloaded-virtual -Wsign-promo -Wsynth -Wold-style-cast
40
# Would like to enable, but too many stupid warnings. (comma at end of enumerator list, anonymous structs
42
# would like to enable, but cannot (too many warnings in system headers.).
44
NO_WARN=-Wno-long-long -Wno-inline
46
#Standard include locations
47
CXXFLAGS += -Ilibraries/common/ -Iinclude/ -Llib/ $(EXTRA_CXXFLAGS) $(WARNINGS) $(WARNINGS_CXX) $(NO_WARN) -O2
48
CFLAGS += -Ilibraries/common/ -Iinclude/ -Llib/ $(EXTRA_CFLAGS) $(WARNINGS) $(NO_WARN) -O2
51
# 0.1.0 == 22 Dec 2001 initial import into CVS.
53
#--------------------------------------------
54
# Generic Makefile stuff is below. You
55
# should not have to modify any of the stuff
57
#--------------------------------------------
62
#Included makefiles will add their deps for each stage in these vars:
79
BASE_STATIC_DEBUG_LIBS :=
85
#Define the top-level build directory
86
BUILDDIR := $(shell pwd)
88
include build/Rules.make-linux
89
include build/Rules.make-common
92
include libraries/module.mk
95
include cppunit/module.mk
101
include bins/module.mk
104
include supported-bins/module.mk
108
#Include the docs in the build
109
# doc_FILES += COPYING INSTALL README
112
minimal: $(BASE_BINS)
113
static: $(BASE_BINS_STATIC) $(EXT_BINS_STATIC)
115
clean: clean_list $(CLEAN_DEPS)
119
distclean: clean distclean_list $(DISTCLEAN_DEPS)
121
rm -rf $(DISTCLEAN_LIST)
123
install_list: $(INSTALL_LIST)
124
install: all $(INSTALL_DEPS) install_list
127
tarball: $(RELEASE_STRING).tar.bz2
128
zip: $(RELEASE_STRING).zip
133
@echo "Libsmbios Version: $(RELEASE_VERSION)"
135
$(RELEASE_STRING).zip $(RELEASE_STRING).tar.bz2: $(shell find . -name \*.cpp -o -name \*.h -o -name \*.mk -o -name \*.hpp -o -name \*.in ) Makefile
136
$(SIL)[ ! -e $(RELEASE_STRING) ] || rm -rf $(RELEASE_STRING)
137
$(SIL)[ ! -e $(RELEASE_STRING).tar.bz2 ] || rm -rf $(RELEASE_STRING).tar.bz2
138
$(SIL)[ ! -e $(RELEASE_STRING).zip ] || rm -rf $(RELEASE_STRING).zip
139
find . -depth | grep -v ^./$(RELEASE_STRING) | grep -v ^rpm/ | cpio -pdm $(RELEASE_STRING)
140
rm -f $(RELEASE_STRING)/include/smbios/version.h
141
$(SIL)make -s -C $(RELEASE_STRING) include/smbios/version.h
142
$(SIL)make -s -C $(RELEASE_STRING) libsmbios.spec
143
$(SIL)make -s -C $(RELEASE_STRING) libraries/common/StdSmbiosXml.h
144
$(SIL)mv $(RELEASE_STRING)/libraries/common/StdSmbiosXml.h $(RELEASE_STRING)/libraries/common/StdSmbiosXml.h-save
145
$(SIL)make -s -C $(RELEASE_STRING) distclean
146
$(SIL)mv $(RELEASE_STRING)/libraries/common/StdSmbiosXml.h-save $(RELEASE_STRING)/libraries/common/StdSmbiosXml.h
147
$(SIL)find $(RELEASE_STRING) -name \*.d -exec rm {} \;
148
tar cjf $(RELEASE_STRING).tar.bz2 $(RELEASE_STRING)
149
zip -r $(RELEASE_STRING).zip $(RELEASE_STRING)
150
$(SIL)rm -rf $(RELEASE_STRING)/
153
BLD_DIR=$$(mktemp -d /tmp/rpmbuild-$$$$-XXXXXX); \
154
mkdir -p $$BLD_DIR/SOURCES $$BLD_DIR/BUILD $$BLD_DIR/RPMS $$BLD_DIR/RPMS/i386 $$BLD_DIR/RPMS/noarch $$BLD_DIR/SRPMS $$BLD_DIR/SPECS ;\
155
rpmbuild --define "_topdir $$BLD_DIR" -ta $(RELEASE_STRING).tar.bz2 ;\
156
cp $$BLD_DIR/RPMS/*/*rpm . ;\
157
cp $$BLD_DIR/SRPMS/*rpm . ;\
161
BLD_DIR=$$(mktemp -d /tmp/rpmbuild-$$$$-XXXXXX); \
162
mkdir -p $$BLD_DIR/SOURCES $$BLD_DIR/BUILD $$BLD_DIR/RPMS $$BLD_DIR/RPMS/i386 $$BLD_DIR/RPMS/noarch $$BLD_DIR/SRPMS $$BLD_DIR/SPECS ;\
163
rpmbuild --define "_topdir $$BLD_DIR" -ts --nodeps $(RELEASE_STRING).tar.bz2 ;\
164
cp $$BLD_DIR/SRPMS/*rpm . ;\
167
CLEAN_LIST += $(RELEASE_NAME)*.rpm
168
CLEAN_LIST += $(RELEASE_STRING).tar.bz2
169
CLEAN_LIST += $(RELEASE_STRING).zip
170
CLEAN_LIST += $(shell find . -name .\#\* )
171
CLEAN_LIST += $(shell find . -name core )
172
CLEAN_LIST += $(shell find . -name .\*.swp )
173
CLEAN_LIST += $(shell find . -name \*.pyc )
174
CLEAN_LIST += testResults.xml
177
CLEAN_LIST += build/VC*/*/Debug build/VC*/*/Release build/VC*/*/*.plg build/VC*/*.ncb build/VC*/*.opt
179
.PHONY: all clean clean_list distclean distclean_list \
182
# Here is a list of variables that are assumed Local to each Makefile. You can
183
# safely stomp on these values without affecting the build.