mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-30 07:40:41 +00:00
Create test mac binaries using ld-mac.
This commit is contained in:
parent
6f80df9cdb
commit
f7b12cfbf5
20
Makefile
20
Makefile
@ -8,15 +8,29 @@ MACSRCS=$(wildcard mach/*.c)
|
|||||||
MACBINS=$(MACSRCS:.c=.bin)
|
MACBINS=$(MACSRCS:.c=.bin)
|
||||||
MACTXTS=$(MACSRCS:.c=.txt)
|
MACTXTS=$(MACSRCS:.c=.txt)
|
||||||
|
|
||||||
|
OS=$(shell uname)
|
||||||
|
|
||||||
|
ifeq ($(OS), Linux)
|
||||||
|
MAC_TOOL_DIR=/usr/i686-apple-darwin10
|
||||||
|
MAC_BIN_DIR=$(MAC_TOOL_DIR)/usr/bin
|
||||||
|
MAC_CC=PATH=$(MAC_BIN_DIR) ./ld-mac $(MAC_BIN_DIR)/gcc --sysroot=$(MAC_TOOL_DIR)
|
||||||
|
MAC_OTOOL=./ld-mac $(MAC_BIN_DIR)/otool
|
||||||
|
MAC_TARGETS=ld-mac $(MACBINS) $(MACTXTS)
|
||||||
|
else
|
||||||
|
MAC_CC=$(CC)
|
||||||
|
MAC_OTOOL=otool
|
||||||
|
MAC_TARGETS=$(MACBINS) $(MACTXTS)
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(EXES)
|
all: $(EXES)
|
||||||
|
|
||||||
mac: $(MACBINS) $(MACTXTS)
|
mach: $(MAC_TARGETS)
|
||||||
|
|
||||||
$(MACBINS): %.bin: %.c
|
$(MACBINS): %.bin: %.c
|
||||||
$(CC) -g $^ -o $@
|
$(MAC_CC) -g $^ -o $@
|
||||||
|
|
||||||
$(MACTXTS): %.txt: %.bin
|
$(MACTXTS): %.txt: %.bin
|
||||||
otool -hLltvV $^ > $@
|
$(MAC_OTOOL) -hLltvV $^ > $@
|
||||||
|
|
||||||
#ok: macho2elf
|
#ok: macho2elf
|
||||||
# ./genelf.sh
|
# ./genelf.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user