rockbox/utils/nwztools/upgtools/Makefile
Amaury Pouly 53d2742a48 nwztools: add support for new UPG format on post-WM1/A30 devices
The new code supports reading and writing UPG files. I kept the old keysig
search code but it only supports the old format (the new format has too long
keys anyway). Since we now have to support two types of encryption(DES and AES),
I reorganized the crypto routines and clean-up some code.

Change-Id: Ie9be220ec2431ec6d0bd11699fa0493b62e1cec2
2020-10-11 13:08:03 +02:00

40 lines
963 B
Makefile

DEFINES=
CC=gcc
CXX=g++
LD=g++
PROFILE=
PKGCONFIG := $(CROSS)pkg-config
# Distros could use different names for the crypto library. We try a list
# of candidate names, only one of them should be the valid one.
LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++
$(foreach l,$(LIBCRYPTO_NAMES),\
$(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l))))
$(foreach l,$(LIBCRYPTO_NAMES),\
$(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
$(foreach l,$(LIBCRYPTO_NAMES),\
$(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES)
CFLAGS=-g $(PROFILE) -Wall -std=c99 $(DEFINES)
LDFLAGS=$(PROFILE) $(LDOPTS) -lpthread
BINS=upgtool
all: $(BINS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
upgtool: upgtool.o upg.o misc.o mg.o keysig_search.o md5.o
$(LD) -o $@ $^ $(LDFLAGS)
clean:
rm -fr *.o
veryclean:
rm -rf $(BINS)