rockbox/utils/imxtools/sbtools/Makefile
Dominik Riebeling 2037b837f8 sbtools: convert crypto to libtomcrypt.
Replace the use of crypto++ with tomcrypt, which is much smaller and C.
This gets rid of various build issues for systems that don't ship
crypo++ (i.e. everything except Linux.)

Change-Id: Ic0799e17b94935c71b14765cf9a2a7ea2b0adc7a
2020-10-18 19:08:32 +02:00

44 lines
1,015 B
Makefile

DEFINES=
CC := gcc
CXX := g++
LD := g++
TOMCRYPT_DIR := ../../tomcrypt/
CFLAGS := -O3 -g -std=c99 -Wall $(shell pkg-config --cflags libusb-1.0) $(DEFINES) -I$(TOMCRYPT_DIR)/src/headers
CXXFLAGS := -O3 -g -Wall $(DEFINES) -I$(TOMCRYPT_DIR)/src/headers
LDFLAGS := $(shell pkg-config --libs libusb-1.0)
BINS := elftosb sbtoelf sbloader rsrctool elftosb1
all: $(BINS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
sbtoelf: sbtoelf.o crc.o crypto.o xorcrypt.o dbparser.o elf.o misc.o sb.o sb1.o $(TOMCRYPT_DIR)/librbtomcrypt.a
$(LD) -o $@ $^ $(LDFLAGS)
elftosb: elftosb.o crc.o crypto.o elf.o dbparser.o misc.o sb.o $(TOMCRYPT_DIR)/librbtomcrypt.a
$(LD) -o $@ $^ $(LDFLAGS)
elftosb1: elftosb1.o xorcrypt.o elf.o misc.o sb1.o
$(LD) -o $@ $^ $(LDFLAGS)
sbloader: sbloader.o
$(LD) -o $@ $^ $(LDFLAGS)
rsrctool: rsrctool.o rsrc.o misc.o
$(LD) -o $@ $^ $(LDFLAGS)
clean:
rm -fr *.o
veryclean:
rm -rf $(BINS)
$(TOMCRYPT_DIR)/librbtomcrypt.a:
$(MAKE) -C $(TOMCRYPT_DIR)