123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #
- # Makefile for nvmutils
- #
- # Copyright (C) 2022 Leah Rowe <info@minifree.org>
- #
- # Permission is hereby granted, free of charge, to any person obtaining a
- # copy of this software and associated documentation files (the
- # "Software"), to deal in the Software without restriction, including
- # without limitation the rights to use, copy, modify, merge, publish,
- # distribute, sublicense, and/or sell copies of the Software, and to
- # permit persons to whom the Software is furnished to do so, subject to
- # the following conditions:
- #
- # The above copyright notice and this permission notice shall be included
- # in all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- #
- # config:
- # ----------
- CC=cc
- FORCEC99=-std=c99
- CFLAGS=-I. -Wall -Wextra -g $(FORCEC99)
- NOLINKER=-c
- # commands:
- # ----------
- all: clean nvmmac nvmcheck nvmfix nvmbrick nvmcp nvmswap
- nvmmac: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o obj/lib/mac.o \
- obj/lib/word.o obj/nvmmac.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/mac.o obj/lib/word.o obj/nvmmac.o -o nvmmac
- nvmcheck: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmcheck.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmcheck.o -o nvmcheck
- nvmfix: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o obj/lib/word.o \
- obj/nvmfix.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmfix.o -o nvmfix
- nvmbrick: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmbrick.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmbrick.o -o nvmbrick
- nvmcp: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o obj/lib/word.o \
- obj/nvmcp.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmcp.o -o nvmcp
- nvmswap: obj/lib/checksum.o obj/lib/version.o obj/lib/file.o obj/lib/word.o \
- obj/nvmswap.o
- $(CC) $(CFLAGS) obj/lib/checksum.o obj/lib/version.o obj/lib/file.o \
- obj/lib/word.o obj/nvmswap.o -o nvmswap
- clean:
- rm -f nvmmac nvmcheck nvmfix nvmbrick nvmcp nvmswap obj/*.o obj/lib/*.o
- # utils:
- # ----------
- obj/nvmmac.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmmac.c -o obj/nvmmac.o
- obj/nvmcheck.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmcheck.c -o obj/nvmcheck.o
- obj/nvmfix.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmfix.c -o obj/nvmfix.o
- obj/nvmbrick.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmbrick.c -o obj/nvmbrick.o
- obj/nvmcp.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmcp.c -o obj/nvmcp.o
- obj/nvmswap.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/nvmswap.c -o obj/nvmswap.o
- # libs:
- # ----------
- obj/lib/checksum.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/lib/checksum.c -o obj/lib/checksum.o
- obj/lib/version.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/lib/version.c -o obj/lib/version.o
- obj/lib/file.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/lib/file.c -o obj/lib/file.o
- obj/lib/mac.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/lib/mac.c -o obj/lib/mac.o
- obj/lib/word.o:
- $(CC) $(CFLAGS) $(NOLINKER) src/lib/word.c -o obj/lib/word.o
|