Zerocat Chipflasher  v0.4.10-732-9a3cc90b
Flash free firmware to BIOS chips, kick the Management Engine.
Makefile File Reference

Build the chipflasher’s software, i.e. kick and connect. More...

Detailed Description

Documentation

Please compare to:

https://www.gnu.org/software/make/manual/make.html#Simple-Makefile

Code

##>! @file
##>!
##>! @brief Build the chipflasher’s software, i.e. `kick` and `connect`.
##>!
##>! # Copyright
##>!
##>! Zerocat Chipflasher --- Flash free firmware to BIOS chips,
##>!                         kick the Management Engine.
##>!
##>! Copyright (C) 2016-2018, 2020, 2021 Kai Mertens <kmx@posteo.net>
##>!
##>! The Zerocat Chipflasher is free software: you can redistribute it
##>! and/or modify it under the terms of the GNU General Public License
##>! as published by the Free Software Foundation, either version 3 of
##>! the License, or (at your option) any later version.
##>!
##>! The Zerocat Chipflasher is distributed in the hope that it will be
##>! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
##>! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##>! GNU General Public License for more details.
##>!
##>! You should have received a copy of the GNU General Public License
##>! along with this program.  If not, see <http://www.gnu.org/licenses/>.
##>!
##>! This file is part of the Zerocat Chipflasher.
##>!
##>! # “In file” Documentation
##>!
##>! ## Usage
##>!
##>!     $ make help
##>!
##>! @cond
#

# Shell
SHELL                         := /bin/sh

# White Space
EMPTY                         :=
SPACE                         := $(EMPTY) $(EMPTY)
COMMA                         := ,
M5                            := xxxxx

# Suffixes
.SUFFIXES :
.SUFFIXES : .o .c .h

# Root Paths
ROOT_DOC                      := ../../doc/
ROOT_FIRMWARE_SRC             := ../../firmware/src/

# Utilities
RM                            := $(shell command -v rm)
RMFLAGS                       :=
$(if $(strip $(RM)),,         $(error Cannot find rm utility))

ECHO                          := $(shell command -v echo)
ECHOFLAGS                     := -e
$(if $(strip $(ECHO)),,       $(error Cannot find echo utility))

CC                            := $(shell command -v gcc)
CFLAGS                        := -Wall
CFLAGS_DEBUG                  := -O0 -g -Wall
LIBCOMMON                     := $(wildcard $(ROOT_FIRMWARE_SRC)libcommon/*)
$(if $(strip $(CC)),,         $(error Cannot find cc utility))

# Files
DOXYORIG                      := $(ROOT_DOC)doxygen-resources/Doxyfile.orig

# Built-in Special Targets
#~ .SECONDARY :                     # uncomment for debugging
.PHONY : all kick clean-kick clean-connect clean help hello

# Targets
#  all software, kick and connect
all : hello kick connect

$(ROOT_FIRMWARE_SRC)libcommon/common.h.tmp : $(ROOT_FIRMWARE_SRC)libcommon/common.h $(DOXYORIG)
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	$(MAKE) \
		-C $(ROOT_FIRMWARE_SRC) \
			libcommon/common.h.tmp

kick :
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	$(MAKE) \
		-C $(ROOT_FIRMWARE_SRC);

connect : connect.o
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	$(CC) $(CFLAGS) \
		-o connect \
			connect.o;

connect.o : connect.c connect.h $(ROOT_FIRMWARE_SRC)libcommon/common.h.tmp $(LIBCOMMON)
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	$(CC) $(CFLAGS) \
		-c \
			connect.c;

clean-kick :
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	$(MAKE) \
		-C $(ROOT_FIRMWARE_SRC) \
			clean;

clean-connect :
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	-$(RM) $(RMFLAGS) \
		connect \
		connect.o;

clean : hello clean-kick clean-connect
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";

#  display help information
help : hello
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5) Process target “$@” $(M5)$(M5)";
	@$(ECHO) $(ECHOFLAGS) \
		"\nList Of Targets"\
		"\n---------------"\
		"\nall\r\t\tbuild kick and connect"\
		"\nkick\r\t\tbuild kick"\
		"\nconnect\r\t\tbuild connect"\
		"\nclean-kick\r\t\tclean kick"\
		"\nclean-connect\r\t\tclean connect"\
		"\nclean\r\t\tclean kick and connect"\
		"\nhelp\r\t\tdisplay this help information"\
		"\nhello\r\t\tgreeter, provided with all, clean and help"\
		"\n";

#  display greeting
#   provided with all, clean and help
hello :
	@$(ECHO) $(ECHOFLAGS) \
		"\n$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)"\
		"\n$(M5) Zerocat Chipflasher – Build the Software"\
		"\n$(M5) This Makefile builds “kick” and “connect”."\
		"\n$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)$(M5)";

##>! @endcond

Copyright

Zerocat Chipflasher — Flash free firmware to BIOS chips, kick the Management Engine.

Copyright (C) 2016-2018, 2020, 2021 Kai Mertens kmx@p.nosp@m.oste.nosp@m.o.net

The Zerocat Chipflasher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Zerocat Chipflasher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This file is part of the Zerocat Chipflasher.

“In file” Documentation

Usage

$ make help