mirror of
https://github.com/frida/tinycc
synced 2024-12-26 23:09:41 +03:00
win32: libtcc1.a needs to be built with tcc
gcc/mingw produces msvc compatible pecoff objects, tcc only knows ELF.
This commit is contained in:
parent
f01373765b
commit
76accfb8d5
@ -6,7 +6,7 @@ TOP = ..
|
|||||||
include $(TOP)/Makefile
|
include $(TOP)/Makefile
|
||||||
VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib
|
VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib
|
||||||
|
|
||||||
ifndef TARGET
|
ifndef TARGET # native library
|
||||||
ifdef CONFIG_WIN64
|
ifdef CONFIG_WIN64
|
||||||
TARGET = x86_64-win32
|
TARGET = x86_64-win32
|
||||||
else
|
else
|
||||||
@ -27,6 +27,7 @@ ifndef TARGET
|
|||||||
else
|
else
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
TARGET = arm
|
TARGET = arm
|
||||||
|
XCC = $(CC)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -58,12 +59,14 @@ ifeq "$(TARGET)" "i386-win32"
|
|||||||
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
|
TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
|
||||||
XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
|
XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
|
||||||
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
||||||
|
PICFLAGS =
|
||||||
else
|
else
|
||||||
ifeq "$(TARGET)" "x86_64-win32"
|
ifeq "$(TARGET)" "x86_64-win32"
|
||||||
OBJ = $(addprefix $(DIR)/,$(WIN64_O))
|
OBJ = $(addprefix $(DIR)/,$(WIN64_O))
|
||||||
TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE
|
TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE
|
||||||
XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
|
XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
|
||||||
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
XAR = $(DIR)/tiny_libmaker$(EXESUF)
|
||||||
|
PICFLAGS =
|
||||||
else
|
else
|
||||||
ifeq "$(TARGET)" "i386"
|
ifeq "$(TARGET)" "i386"
|
||||||
OBJ = $(addprefix $(DIR)/,$(I386_O))
|
OBJ = $(addprefix $(DIR)/,$(I386_O))
|
||||||
@ -104,7 +107,7 @@ $(DIR)/libtcc1.a ../libtcc1.a : $(OBJ) $(XAR)
|
|||||||
$(DIR)/%.o : %.c
|
$(DIR)/%.o : %.c
|
||||||
$(XCC) -c $< -o $@ $(XFLAGS)
|
$(XCC) -c $< -o $@ $(XFLAGS)
|
||||||
$(DIR)/%.o : %.S
|
$(DIR)/%.o : %.S
|
||||||
$(CC) -c $< -o $@ $(XFLAGS)
|
$(XCC) -c $< -o $@ $(XFLAGS)
|
||||||
$(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c
|
$(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c
|
||||||
$(CC) -o $@ $< $(XFLAGS) $(LDFLAGS)
|
$(CC) -o $@ $< $(XFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
TOP = ../..
|
TOP = ../..
|
||||||
include $(TOP)/Makefile
|
include $(TOP)/Makefile
|
||||||
VPATH = $(top_srcdir)/tests/tests2
|
|
||||||
|
|
||||||
TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include
|
|
||||||
ifdef CONFIG_WIN32
|
ifdef CONFIG_WIN32
|
||||||
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
|
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
|
||||||
|
else
|
||||||
|
TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
@ -94,7 +94,7 @@ endif
|
|||||||
@if [ "x`echo $* | grep args`" != "x" ]; \
|
@if [ "x`echo $* | grep args`" != "x" ]; \
|
||||||
then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \
|
then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \
|
||||||
else $(TCC) -run $< >$*.output 2>&1; \
|
else $(TCC) -run $< >$*.output 2>&1; \
|
||||||
($(TCC) -o $*.exe $< -lm && ./$*.exe) >$*.output2 2>&1; \
|
($(TCC) -o $*.exe $< && ./$*.exe) >$*.output2 2>&1; \
|
||||||
fi || true
|
fi || true
|
||||||
@if diff -bu $(<:.c=.expect) $*.output ; \
|
@if diff -bu $(<:.c=.expect) $*.output ; \
|
||||||
then rm -f $*.output; \
|
then rm -f $*.output; \
|
||||||
|
Loading…
Reference in New Issue
Block a user