2018-01-24 17:52:25 +00:00
|
|
|
include config.mk
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
2018-01-29 18:39:30 +00:00
|
|
|
INCLUDE = -I ./mbedtls/include
|
|
|
|
LIBDIR = ./mbedtls/library
|
2018-01-24 22:18:27 +00:00
|
|
|
CFLAGS += -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE -D__USE_MINGW_ANSI_STDIO=1 -D_FILE_OFFSET_BITS=64
|
2018-01-24 17:52:25 +00:00
|
|
|
|
2018-01-29 18:39:30 +00:00
|
|
|
all:
|
2020-01-25 17:15:22 +00:00
|
|
|
$(MAKE) -C mbedtls lib
|
2020-01-25 17:13:01 +00:00
|
|
|
$(MAKE) hactool$(EXEEXT)
|
2018-01-24 17:52:25 +00:00
|
|
|
|
|
|
|
.c.o:
|
2018-01-29 18:39:30 +00:00
|
|
|
$(CC) $(INCLUDE) -c $(CFLAGS) -o $@ $<
|
2018-01-24 17:52:25 +00:00
|
|
|
|
2020-01-25 17:13:01 +00:00
|
|
|
hactool$(EXEEXT): save.o sha.o aes.o extkeys.o rsa.o npdm.o bktr.o kip.o packages.o pki.o pfs0.o hfs0.o nca0_romfs.o romfs.o utils.o nax0.o nso.o lz4.o nca.o xci.o main.o filepath.o ConvertUTF.o cJSON.o
|
2020-01-25 17:12:35 +00:00
|
|
|
$(CC) -o $@ $^ -L $(LIBDIR) $(LDFLAGS)
|
2018-01-24 17:52:25 +00:00
|
|
|
|
|
|
|
aes.o: aes.h types.h
|
|
|
|
|
2018-01-27 05:31:55 +00:00
|
|
|
bktr.o: bktr.h types.h
|
|
|
|
|
2018-02-06 08:04:27 +00:00
|
|
|
extkeys.o: extkeys.h types.h settings.h
|
|
|
|
|
2018-01-24 17:52:25 +00:00
|
|
|
filepath.o: filepath.c types.h
|
|
|
|
|
2018-02-04 06:09:16 +00:00
|
|
|
hfs0.o: hfs0.h types.h
|
|
|
|
|
2018-02-07 08:10:26 +00:00
|
|
|
kip.o: kip.h types.h
|
|
|
|
|
2018-07-24 07:14:48 +00:00
|
|
|
lz4.o: lz4.h
|
|
|
|
|
2018-01-24 17:52:25 +00:00
|
|
|
main.o: main.c pki.h types.h
|
|
|
|
|
2018-02-07 08:10:26 +00:00
|
|
|
packages.o: packages.h aes.h kip.h types.h
|
2018-02-06 23:52:48 +00:00
|
|
|
|
2018-02-03 01:06:33 +00:00
|
|
|
pfs0.o: pfs0.h types.h
|
|
|
|
|
2018-02-03 04:57:24 +00:00
|
|
|
pki.o: pki.h aes.h types.h
|
|
|
|
|
2018-04-03 22:26:56 +00:00
|
|
|
nax0.o: nax0.h aes.h sha.h types.h
|
|
|
|
|
2018-01-27 05:31:55 +00:00
|
|
|
nca.o: nca.h aes.h sha.h rsa.h bktr.h filepath.h types.h
|
2018-01-24 17:52:25 +00:00
|
|
|
|
2018-05-03 00:35:19 +00:00
|
|
|
npdm.o: npdm.c cJSON.h types.h
|
2018-01-24 17:52:25 +00:00
|
|
|
|
2018-07-24 07:14:48 +00:00
|
|
|
nso.o: nso.h types.h
|
|
|
|
|
2018-02-04 05:18:53 +00:00
|
|
|
romfs.o: ivfc.h types.h
|
|
|
|
|
2018-07-20 09:57:28 +00:00
|
|
|
nca0_romfs.o: nca0_romfs.h ivfc.h types.h
|
|
|
|
|
2018-01-24 17:52:25 +00:00
|
|
|
rsa.o: rsa.h sha.h types.h
|
|
|
|
|
2019-10-18 17:19:46 +00:00
|
|
|
save.o: save.h ivfc.h aes.h sha.h filepath.h types.h
|
|
|
|
|
2018-01-24 17:52:25 +00:00
|
|
|
sha.o: sha.h types.h
|
|
|
|
|
|
|
|
utils.o: utils.h types.h
|
|
|
|
|
2018-02-04 08:21:04 +00:00
|
|
|
xci.o: xci.h types.h hfs0.h
|
|
|
|
|
2018-02-05 03:08:53 +00:00
|
|
|
ConvertUTF.o: ConvertUTF.h
|
|
|
|
|
2018-05-03 00:35:19 +00:00
|
|
|
cJSON.o: cJSON.h
|
|
|
|
|
2018-01-24 17:52:25 +00:00
|
|
|
clean:
|
2018-02-03 05:35:43 +00:00
|
|
|
rm -f *.o hactool hactool.exe
|
2018-02-04 08:21:04 +00:00
|
|
|
|
|
|
|
clean_full:
|
|
|
|
rm -f *.o hactool hactool.exe
|
2020-01-25 17:15:22 +00:00
|
|
|
$(MAKE)-C mbedtls clean
|
2018-01-24 17:52:25 +00:00
|
|
|
|
2018-02-07 08:38:12 +00:00
|
|
|
dist: clean_full
|
2018-02-03 05:35:43 +00:00
|
|
|
$(eval HACTOOLVER = $(shell grep '\bHACTOOL_VERSION\b' version.h \
|
2018-02-07 08:38:12 +00:00
|
|
|
| cut -d' ' -f3 \
|
2018-01-24 17:52:25 +00:00
|
|
|
| sed -e 's/"//g'))
|
2018-02-03 05:35:43 +00:00
|
|
|
mkdir hactool-$(HACTOOLVER)
|
2018-02-07 08:38:12 +00:00
|
|
|
cp -R *.c *.h config.mk.template Makefile README.md LICENSE mbedtls hactool-$(HACTOOLVER)
|
2018-02-03 05:35:43 +00:00
|
|
|
tar czf hactool-$(HACTOOLVER).tar.gz hactool-$(HACTOOLVER)
|
|
|
|
rm -r hactool-$(HACTOOLVER)
|