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
6include $(TOP)/Makefile6include $(TOP)/Makefile
7VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib7VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib
8 8
9ifndef TARGET9ifndef TARGET # native library
10 ifdef CONFIG_WIN6410 ifdef CONFIG_WIN64
11 TARGET = x86_64-win3211 TARGET = x86_64-win32
12 else12 else
@@ -27,6 +27,7 @@ ifndef TARGET · 14 unmodified lines
27 else27 else
28 ifeq ($(ARCH),arm)28 ifeq ($(ARCH),arm)
29 TARGET = arm29 TARGET = arm
30 XCC = $(CC)
30 endif31 endif
31 endif32 endif
32 endif33 endif
@@ -58,12 +59,14 @@ ifeq "$(TARGET)" "i386-win32" · 25 unmodified lines
58 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE59 TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE
59 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include60 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
60 XAR = $(DIR)/tiny_libmaker$(EXESUF)61 XAR = $(DIR)/tiny_libmaker$(EXESUF)
62 PICFLAGS =
61else63else
62ifeq "$(TARGET)" "x86_64-win32"64ifeq "$(TARGET)" "x86_64-win32"
63 OBJ = $(addprefix $(DIR)/,$(WIN64_O))65 OBJ = $(addprefix $(DIR)/,$(WIN64_O))
64 TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE66 TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE
65 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include67 XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include
66 XAR = $(DIR)/tiny_libmaker$(EXESUF)68 XAR = $(DIR)/tiny_libmaker$(EXESUF)
69 PICFLAGS =
67else70else
68ifeq "$(TARGET)" "i386"71ifeq "$(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 : %.c107$(DIR)/%.o : %.c
105 $(XCC) -c $< -o $@ $(XFLAGS)108 $(XCC) -c $< -o $@ $(XFLAGS)
106$(DIR)/%.o : %.S109$(DIR)/%.o : %.S
107 $(CC) -c $< -o $@ $(XFLAGS)110 $(XCC) -c $< -o $@ $(XFLAGS)
108$(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c111$(DIR)/%$(EXESUF) : $(TOP)/win32/tools/%.c
109 $(CC) -o $@ $< $(XFLAGS) $(LDFLAGS)112 $(CC) -o $@ $< $(XFLAGS) $(LDFLAGS)
110 113
tests/tests2/Makefile+3−3
@@ -1,10 +1,10 @@
1TOP = ../..1TOP = ../..
2include $(TOP)/Makefile2include $(TOP)/Makefile
3VPATH = $(top_srcdir)/tests/tests2
4 3
5TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include
6ifdef CONFIG_WIN324ifdef 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)
6else
7 TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm
8endif8endif
9 9
10ifeq ($(TARGETOS),Darwin)10ifeq ($(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 || true98 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; \

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