History

win32: libtcc1.a needs to be built with tcc

gcc/mingw produces msvc compatible pecoff objects, tcc only knows ELF.

grischka committed 12 years ago

Commit 76accfb1 parent f0137372 files · +8 −5Browse files

Unified · Split

2 files
  1. lib/Makefile +5 −2
  2. tests/tests2/Makefile +3 −3
lib/Makefile+5−2
@@ -6,7 +6,7 @@ TOP = .. · 5 unmodified lines
66 include $(TOP)/Makefile
77 VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib
88
9−ifndef TARGET
9+ifndef TARGET # native library
1010 ifdef CONFIG_WIN64
1111 TARGET = x86_64-win32
1212 else
@@ -27,6 +27,7 @@ ifndef TARGET · 14 unmodified lines
2727 else
2828 ifeq ($(ARCH),arm)
2929 TARGET = arm
30+ XCC = $(CC)
3031 endif
3132 endif
3233 endif
@@ -58,12 +59,14 @@ ifeq "$(TARGET)" "i386-win32" · 25 unmodified lines
5859 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
5960 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
6061 XAR = $(DIR)/tiny_libmaker$(EXESUF)
62+ PICFLAGS =
6163 else
6264 ifeq "$(TARGET)" "x86_64-win32"
6365 OBJ = $(addprefix $(DIR)/,$(WIN64_O))
6466 TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE
6567 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
6668 XAR = $(DIR)/tiny_libmaker$(EXESUF)
69+ PICFLAGS =
6770 else
6871 ifeq "$(TARGET)" "i386"
6972 OBJ = $(addprefix $(DIR)/,$(I386_O))
@@ -104,7 +107,7 @@ $(DIR)/libtcc1.a ../libtcc1.a : $(OBJ) $(XAR) · 34 unmodified lines
104107 $(DIR)/%.o : %.c
105108 $(XCC) -c $< -o $@ $(XFLAGS)
106109 $(DIR)/%.o : %.S
107− $(CC) -c $< -o $@ $(XFLAGS)
110+ $(XCC) -c $< -o $@ $(XFLAGS)
108111 $(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c
109112 $(CC) -o $@ $< $(XFLAGS) $(LDFLAGS)
110113
tests/tests2/Makefile+3−3
@@ -1,10 +1,10 @@
11 TOP = ../..
22 include $(TOP)/Makefile
3−VPATH = $(top_srcdir)/tests/tests2
43
5−TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include
64 ifdef CONFIG_WIN32
75 TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
6+else
7+ TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm
88 endif
99
1010 ifeq ($(TARGETOS),Darwin)
@@ -94,7 +94,7 @@ endif · 83 unmodified lines
9494 @if [ "x`echo $* | grep args`" != "x" ]; \
9595 then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \
9696 else $(TCC) -run $< >$*.output 2>&1; \
97− ($(TCC) -o $*.exe $< -lm && ./$*.exe) >$*.output2 2>&1; \
97+ ($(TCC) -o $*.exe $< && ./$*.exe) >$*.output2 2>&1; \
9898 fi || true
9999 @if diff -bu $(<:.c=.expect) $*.output ; \
100100 then rm -f $*.output; \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t