gcc/mingw produces msvc compatible pecoff objects, tcc only knows ELF.
Unified · Split
| @@ -6,7 +6,7 @@ TOP = .. · 5 unmodified lines | ||
| 6 | 6 | include $(TOP)/Makefile |
| 7 | 7 | VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib |
| 8 | 8 | |
| 9 | −ifndef TARGET | |
| 9 | +ifndef TARGET # native library | |
| 10 | 10 | ifdef CONFIG_WIN64 |
| 11 | 11 | TARGET = x86_64-win32 |
| 12 | 12 | else |
| @@ -27,6 +27,7 @@ ifndef TARGET · 14 unmodified lines | ||
| 27 | 27 | else |
| 28 | 28 | ifeq ($(ARCH),arm) |
| 29 | 29 | TARGET = arm |
| 30 | + XCC = $(CC) | |
| 30 | 31 | endif |
| 31 | 32 | endif |
| 32 | 33 | endif |
| @@ -58,12 +59,14 @@ ifeq "$(TARGET)" "i386-win32" · 25 unmodified lines | ||
| 58 | 59 | TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE |
| 59 | 60 | XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include |
| 60 | 61 | XAR = $(DIR)/tiny_libmaker$(EXESUF) |
| 62 | + PICFLAGS = | |
| 61 | 63 | else |
| 62 | 64 | ifeq "$(TARGET)" "x86_64-win32" |
| 63 | 65 | OBJ = $(addprefix $(DIR)/,$(WIN64_O)) |
| 64 | 66 | TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE |
| 65 | 67 | XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include |
| 66 | 68 | XAR = $(DIR)/tiny_libmaker$(EXESUF) |
| 69 | + PICFLAGS = | |
| 67 | 70 | else |
| 68 | 71 | ifeq "$(TARGET)" "i386" |
| 69 | 72 | OBJ = $(addprefix $(DIR)/,$(I386_O)) |
| @@ -104,7 +107,7 @@ $(DIR)/libtcc1.a ../libtcc1.a : $(OBJ) $(XAR) · 34 unmodified lines | ||
| 104 | 107 | $(DIR)/%.o : %.c |
| 105 | 108 | $(XCC) -c $< -o $@ $(XFLAGS) |
| 106 | 109 | $(DIR)/%.o : %.S |
| 107 | − $(CC) -c $< -o $@ $(XFLAGS) | |
| 110 | + $(XCC) -c $< -o $@ $(XFLAGS) | |
| 108 | 111 | $(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c |
| 109 | 112 | $(CC) -o $@ $< $(XFLAGS) $(LDFLAGS) |
| 110 | 113 | |
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | TOP = ../.. |
| 2 | 2 | include $(TOP)/Makefile |
| 3 | −VPATH = $(top_srcdir)/tests/tests2 | |
| 4 | 3 | |
| 5 | −TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include | |
| 6 | 4 | ifdef CONFIG_WIN32 |
| 7 | 5 | TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP) |
| 6 | +else | |
| 7 | + TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm | |
| 8 | 8 | endif |
| 9 | 9 | |
| 10 | 10 | ifeq ($(TARGETOS),Darwin) |
| @@ -94,7 +94,7 @@ endif · 83 unmodified lines | ||
| 94 | 94 | @if [ "x`echo $* | grep args`" != "x" ]; \ |
| 95 | 95 | then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \ |
| 96 | 96 | else $(TCC) -run $< >$*.output 2>&1; \ |
| 97 | − ($(TCC) -o $*.exe $< -lm && ./$*.exe) >$*.output2 2>&1; \ | |
| 97 | + ($(TCC) -o $*.exe $< && ./$*.exe) >$*.output2 2>&1; \ | |
| 98 | 98 | fi || true |
| 99 | 99 | @if diff -bu $(<:.c=.expect) $*.output ; \ |
| 100 | 100 | then rm -f $*.output; \ |