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