ios-kernel-patch/Makefile
2012-09-30 00:36:24 -04:00

44 lines
1.5 KiB
Makefile

DATA := $(word 1,$(wildcard ./data ../data))
EXTRA_DEPS := $(wildcard $(DATA)/*.h $(DATA)/*/*.h)
override CFLAGS += -I$(DATA)
include $(DATA)/Makefile.common
BINS := $(OUTDIR)/check_sanity $(OUTDIR)/make_kernel_patchfile $(OUTDIR)/apply_patchfile $(OUTDIR)/dump $(OUTDIR)/nm $(OUTDIR)/extract_syms $(OUTDIR)/unpack sandboxc-armv6.c sandboxc-armv7.c
ifneq "$(GXX)" ""
BINS += $(OUTDIR)/grapher
endif
all: .data $(OUTDIR) $(BINS)
$(OUTDIR):
mkdir $(OUTDIR)
sandbox-armv6.o: sandbox.S
$(SDK_GCC) -arch armv6 -c -o $@ $<
sandbox-armv7.o: sandbox.S
$(SDK_GCC) -arch armv7 -c -o $@ $<
sandboxc-%.c: sandbox-%.o
xxd -i $< > $@
$(OUTDIR)/check_sanity: $(OUTDIR)/check_sanity.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/apply_patchfile: $(OUTDIR)/apply_patchfile.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/make_kernel_patchfile: $(OUTDIR)/make_kernel_patchfile.o $(OUTDIR)/sandboxc-armv6.o $(OUTDIR)/sandboxc-armv7.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/dump: $(OUTDIR)/dump.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/nm: $(OUTDIR)/nm.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/extract_syms: $(OUTDIR)/extract_syms.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^
$(OUTDIR)/grapher: $(OUTDIR)/grapher.o $(DATA)/$(OUTDIR)/libdata.a
$(GXX) -o $@ $^ -O3
$(OUTDIR)/unpack: $(OUTDIR)/unpack.o $(DATA)/$(OUTDIR)/libdata.a
$(GCC) -o $@ $^ -O3
$(OUTDIR)/codesign_allocate: $(OUTDIR)/codesign_allocate.o
$(GCC) -o $@ $^ -O3
clean: .clean
rm -f sandboxc-{armv6,armv7}.c sandbox-{armv6,armv7}.o