2017-01-01 19:48:05 +00:00
|
|
|
DEFINES=
|
2019-11-01 11:32:27 +00:00
|
|
|
CC := gcc
|
|
|
|
CXX := g++
|
|
|
|
LD := g++
|
|
|
|
|
|
|
|
LIBUSB := $(shell pkg-config --cflags libusb-1.0)
|
|
|
|
CFLAGS := -O3 -g -std=c99 -Wall $(shell pkg-config --cflags libusb-1.0) $(DEFINES)
|
|
|
|
CXXFLAGS := -O3 -g -Wall $(pkg-config --cflags libcrypto++) $(DEFINES)
|
|
|
|
LDFLAGS := $(shell pkg-config --libs libusb-1.0) $(shell pkg-config --libs libcrypto++)
|
|
|
|
BINS := elftosb sbtoelf sbloader rsrctool elftosb1
|
2011-10-29 14:22:17 +00:00
|
|
|
|
2011-11-06 01:49:13 +00:00
|
|
|
all: $(BINS)
|
2010-11-28 10:53:01 +00:00
|
|
|
|
2011-10-29 14:22:17 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2017-01-01 19:48:05 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
2017-01-03 15:09:34 +00:00
|
|
|
sbtoelf: sbtoelf.o crc.o crypto.o xorcrypt.o dbparser.o elf.o misc.o sb.o sb1.o
|
2011-10-29 17:09:43 +00:00
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
2010-11-28 10:53:01 +00:00
|
|
|
|
2017-01-03 15:09:34 +00:00
|
|
|
elftosb: elftosb.o crc.o crypto.o elf.o dbparser.o misc.o sb.o
|
2011-10-29 17:09:43 +00:00
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
2010-11-28 10:53:01 +00:00
|
|
|
|
2012-12-16 20:22:15 +00:00
|
|
|
elftosb1: elftosb1.o xorcrypt.o elf.o misc.o sb1.o
|
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
2011-11-06 01:49:13 +00:00
|
|
|
sbloader: sbloader.o
|
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
2012-11-29 16:27:34 +00:00
|
|
|
rsrctool: rsrctool.o rsrc.o misc.o
|
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
2010-11-28 10:53:01 +00:00
|
|
|
clean:
|
2011-10-29 14:22:17 +00:00
|
|
|
rm -fr *.o
|
|
|
|
|
|
|
|
veryclean:
|
2011-11-06 01:49:13 +00:00
|
|
|
rm -rf $(BINS)
|