Reorganize the source tree.

* Documentation is now in "docs".
 * Source code is now in "src".
 * Misc. fixes here and there so that everything still works.

I think I got everything in this commit, but I only tested this
on Linux (Make) and Windows (CMake), so I might've messed
something up on other platforms...
This commit is contained in:
gus knight 2015-07-27 16:03:25 -04:00 committed by Augustin Cavalier
parent 694d0fdade
commit 47e06c6d4e
45 changed files with 90 additions and 91 deletions

4
.gitignore vendored
View File

@ -5,7 +5,7 @@ a.out
*.log *.log
tcc_g tcc_g
tcc tcc
/*-tcc /src/*-tcc
tc2.c tc2.c
doc doc
tc3s.c tc3s.c
@ -63,7 +63,7 @@ lib/i386-win32
lib/arm lib/arm
lib/arm64 lib/arm64
tcc-doc.info tcc-doc.info
conftest* conftest*!conftest.c
tiny_libmaker tiny_libmaker
*.dSYM *.dSYM
*~ *~

View File

@ -85,14 +85,14 @@ endif()
file(STRINGS "VERSION" TCC_VERSION) file(STRINGS "VERSION" TCC_VERSION)
list(GET TCC_VERSION 0 TCC_VERSION) list(GET TCC_VERSION 0 TCC_VERSION)
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
configure_file(config.h.in config.h) configure_file(src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h)
configure_file(config.texi.in config.texi) configure_file(docs/config.texi.in ${CMAKE_CURRENT_SOURCE_DIR}/docs/config.texi)
# Utility variables # Utility variables
set(I386_SOURCES i386-gen.c i386-asm.c i386-asm.h i386-tok.h) set(I386_SOURCES src/x86/i386-gen.c src/x86/i386-asm.c src/x86/i386-asm.h src/x86/i386-tok.h)
set(X86_64_SOURCES x86_64-gen.c i386-asm.c x86_64-asm.h) set(X86_64_SOURCES src/x86/x86_64-gen.c src/x86/i386-asm.c src/x86/x86_64-asm.h)
set(ARM_SOURCES arm_gen.c) set(ARM_SOURCES src/arm/arm_gen.c)
set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S) set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S)
set(LIBTCC1_WIN_SOURCES win32/lib/crt1.c win32/lib/wincrt1.c win32/lib/dllcrt1.c win32/lib/dllmain.c win32/lib/chkstk.S) set(LIBTCC1_WIN_SOURCES win32/lib/crt1.c win32/lib/wincrt1.c win32/lib/dllcrt1.c win32/lib/dllmain.c win32/lib/chkstk.S)
@ -157,22 +157,22 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt
if (TCC_BUILD_NATIVE) if (TCC_BUILD_NATIVE)
add_library(libtcc add_library(libtcc
libtcc.c src/libtcc.c
tccpp.c src/tccpp.c
tccgen.c src/tccgen.c
tccelf.c src/tccelf.c
tccasm.c src/tccasm.c
tccrun.c src/tccrun.c
tcc.h src/tcc.h
libtcc.h src/libtcc.h
tcctok.h src/tcctok.h
${tcc_sources} ${tcc_sources}
) )
set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib) set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib)
if(WIN32) if(WIN32)
set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def") set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def")
endif() endif()
add_executable(tcc tcc.c) add_executable(tcc src/tcc.c)
target_link_libraries(tcc libtcc) target_link_libraries(tcc libtcc)
if(NOT WIN32) if(NOT WIN32)
target_link_libraries(tcc dl) target_link_libraries(tcc dl)
@ -185,7 +185,7 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt
endif() endif()
endif() endif()
elseif(${cross_enabled}) elseif(${cross_enabled})
add_executable(${cross_name}-tcc tcc.c) add_executable(${cross_name}-tcc src/tcc.c)
set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}") set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}")
install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH}) install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH})
@ -197,17 +197,17 @@ endmacro()
make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32 make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32
"TCC_TARGET_I386;TCC_TARGET_PE" "TCC_TARGET_I386;TCC_TARGET_PE"
"${I386_SOURCES};tccpe.c" "${I386_SOURCES};src/tccpe.c"
tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi"
) )
make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64 make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64
"TCC_TARGET_X86_64;TCC_TARGET_PE" "TCC_TARGET_X86_64;TCC_TARGET_PE"
"${X86_64_SOURCES};tccpe.c" "${X86_64_SOURCES};src/tccpe.c"
tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi"
) )
make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE
"TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE" "TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE"
"${ARM_SOURCES};tccpe.c" "${ARM_SOURCES};src/tccpe.c"
"" "" "" "" "" ""
) )
make_tcc("i386" i386-linux-gnu TCC_BUILD_I386 make_tcc("i386" i386-linux-gnu TCC_BUILD_I386
@ -248,7 +248,7 @@ make_tcc("" arm-linux-gnu TCC_BUILD_ARM_VFP
) )
make_tcc("" c67 TCC_BUILD_C67 make_tcc("" c67 TCC_BUILD_C67
TCC_TARGET_C67 TCC_TARGET_C67
"c67-gen.c;tcccoff.c" "c67-gen.c;src/tcccoff.c"
"" "" "" "" "" ""
) )
@ -257,14 +257,14 @@ add_subdirectory(tests)
find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin) find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin)
if(MAKEINFO) if(MAKEINFO)
add_custom_command(OUTPUT tcc-doc.html add_custom_command(OUTPUT tcc-doc.html
COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi
) )
set(TCC_DOC_FILES tcc-doc.html) set(TCC_DOC_FILES tcc-doc.html)
if(NOT WIN32) if(NOT WIN32)
add_custom_command(OUTPUT tcc-doc.info add_custom_command(OUTPUT tcc-doc.info
COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi
) )
set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info) set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info)
@ -290,4 +290,3 @@ else()
install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include) install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include)
install(DIRECTORY include/ DESTINATION lib/tcc/win32/include) install(DIRECTORY include/ DESTINATION lib/tcc/win32/include)
endif() endif()

8
configure vendored
View File

@ -337,7 +337,7 @@ strip="${cross_prefix}${strip}"
CONFTEST=./conftest$EXESUF CONFTEST=./conftest$EXESUF
if test -z "$cross_prefix" ; then if test -z "$cross_prefix" ; then
if ! $cc -o $CONFTEST $source_path/conftest.c 2>/dev/null ; then if ! $cc -o $CONFTEST $source_path/src/conftest.c 2>/dev/null ; then
echo "configure: error: '$cc' failed to compile conftest.c." echo "configure: error: '$cc' failed to compile conftest.c."
else else
bigendian="$($CONFTEST bigendian)" bigendian="$($CONFTEST bigendian)"
@ -560,7 +560,7 @@ fi
version=`head $source_path/VERSION` version=`head $source_path/VERSION`
echo "VERSION=$version" >>config.mak echo "VERSION=$version" >>config.mak
echo "#define TCC_VERSION \"$version\"" >> $TMPH echo "#define TCC_VERSION \"$version\"" >> $TMPH
echo "@set VERSION $version" > config.texi echo "@set VERSION $version" >docs/config.texi
echo "SRC_PATH=$source_path" >>config.mak echo "SRC_PATH=$source_path" >>config.mak
if test "$source_path_used" = "yes" ; then if test "$source_path_used" = "yes" ; then
@ -573,9 +573,9 @@ else
fi fi
echo 'top_builddir=$(TOP)' >>config.mak echo 'top_builddir=$(TOP)' >>config.mak
diff $TMPH config.h >/dev/null 2>&1 diff $TMPH src/config.h >/dev/null 2>&1
if test $? -ne 0 ; then if test $? -ne 0 ; then
mv -f $TMPH config.h mv -f $TMPH src/config.h
else else
echo "config.h is unchanged" echo "config.h is unchanged"
fi fi

View File

0
texi2pod.pl → docs/texi2pod.pl Executable file → Normal file
View File

View File

@ -2,9 +2,9 @@
# Tiny C Compiler Makefile for libtcc1.a # Tiny C Compiler Makefile for libtcc1.a
# #
TOP = .. TOP = ../src
include $(TOP)/Makefile include $(TOP)/Makefile
VPATH = $(top_srcdir)/lib $(top_srcdir)/win32/lib VPATH = $(top_srcdir)/../lib $(top_srcdir)/../win32/lib
ifndef TARGET # native library ifndef TARGET # native library
ifdef CONFIG_WIN64 ifdef CONFIG_WIN64
@ -37,7 +37,7 @@ endif
BCHECK_O = bcheck.o BCHECK_O = bcheck.o
DIR = $(TARGET) DIR = $(TARGET)
native : ../libtcc1.a native : $(DIR)/libtcc1.a
cross : $(DIR)/libtcc1.a cross : $(DIR)/libtcc1.a
native : TCC = $(TOP)/tcc$(EXESUF) native : TCC = $(TOP)/tcc$(EXESUF)
@ -61,26 +61,26 @@ CFLAGS := $(filter-out -fstack-protector-strong,$(CFLAGS))
ifeq "$(TARGET)" "i386-win" ifeq "$(TARGET)" "i386-win"
OBJ = $(addprefix $(DIR)/,$(WIN32_O)) OBJ = $(addprefix $(DIR)/,$(WIN32_O))
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 = PICFLAGS =
else else
ifeq "$(TARGET)" "x86_64-win" ifeq "$(TARGET)" "x86_64-win"
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 = PICFLAGS =
else else
ifeq "$(TARGET)" "i386" ifeq "$(TARGET)" "i386"
OBJ = $(addprefix $(DIR)/,$(I386_O)) OBJ = $(addprefix $(DIR)/,$(I386_O))
TGT = -DTCC_TARGET_I386 TGT = -DTCC_TARGET_I386
XCC ?= $(TCC) -B$(TOP) XCC ?= $(TCC) -B$(TOP) -I$(top_srcdir)/../include
else else
ifeq "$(TARGET)" "x86_64" ifeq "$(TARGET)" "x86_64"
OBJ = $(addprefix $(DIR)/,$(X86_64_O)) OBJ = $(addprefix $(DIR)/,$(X86_64_O))
TGT = -DTCC_TARGET_X86_64 TGT = -DTCC_TARGET_X86_64
XCC ?= $(TCC) -B$(TOP) XCC ?= $(TCC) -B$(TOP) -I$(top_srcdir)/../include
else else
ifeq "$(TARGET)" "arm" ifeq "$(TARGET)" "arm"
OBJ = $(addprefix $(DIR)/,$(ARM_O)) OBJ = $(addprefix $(DIR)/,$(ARM_O))
@ -110,7 +110,7 @@ endif
XAR ?= $(AR) XAR ?= $(AR)
$(DIR)/libtcc1.a ../libtcc1.a : $(OBJ) $(XAR) $(DIR)/libtcc1.a : $(OBJ) $(XAR)
$(XAR) rcs $@ $(OBJ) $(XAR) rcs $@ $(OBJ)
$(DIR)/%.o : %.c $(DIR)/%.o : %.c
$(XCC) -c $< -o $@ $(XFLAGS) $(XCC) -c $< -o $@ $(XFLAGS)

View File

@ -3,7 +3,7 @@
# #
TOP ?= . TOP ?= .
include $(TOP)/config.mak include $(TOP)/../config.mak
VPATH = $(top_srcdir) VPATH = $(top_srcdir)
CPPFLAGS += -I$(TOP) # for config.h CPPFLAGS += -I$(TOP) # for config.h
@ -113,14 +113,14 @@ endif
CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c
CORE_FILES += tcc.h config.h libtcc.h tcctok.h CORE_FILES += tcc.h config.h libtcc.h tcctok.h
I386_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h I386_FILES = $(CORE_FILES) x86/i386-gen.c x86/i386-asm.c x86/i386-asm.h x86/i386-tok.h
WIN32_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h tccpe.c WIN32_FILES = $(CORE_FILES) x86/i386-gen.c x86/i386-asm.c x86/i386-asm.h x86/i386-tok.h tccpe.c
WIN64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h tccpe.c WIN64_FILES = $(CORE_FILES) x86/x86_64-gen.c x86/i386-asm.c x86/x86_64-asm.h tccpe.c
WINCE_FILES = $(CORE_FILES) arm-gen.c tccpe.c WINCE_FILES = $(CORE_FILES) arm/arm-gen.c tccpe.c
X86_64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h X86_64_FILES = $(CORE_FILES) x86/x86_64-gen.c x86/i386-asm.c x86/x86_64-asm.h
ARM_FILES = $(CORE_FILES) arm-gen.c ARM_FILES = $(CORE_FILES) arm/arm-gen.c
ARM64_FILES = $(CORE_FILES) arm64-gen.c ARM64_FILES = $(CORE_FILES) arm/arm64-gen.c
C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c C67_FILES = $(CORE_FILES) tms320c67/c67-gen.c tcccoff.c
ifdef CONFIG_WIN64 ifdef CONFIG_WIN64
PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF) PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
@ -249,18 +249,18 @@ libtcc.dll libtcc.def libtcc.a: $(LIBTCC_OBJ)
endif endif
# windows utilities # windows utilities
tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c tiny_impdef$(EXESUF): ../win32/tools/tiny_impdef.c
$(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c tiny_libmaker$(EXESUF): ../win32/tools/tiny_libmaker.c
$(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
# TinyCC runtime libraries # TinyCC runtime libraries
libtcc1.a : FORCE libtcc1.a : FORCE
$(MAKE) -C lib native $(MAKE) -C ../lib native
if test ! -d $(ARCH); then mkdir $(ARCH); fi if test ! -d $(ARCH); then mkdir $(ARCH); fi
if test ! -L $(ARCH)/$@; then ln -sf ../$@ $(ARCH)/$@; fi if test ! -L $(ARCH)/$@; then ln -sf ../$@ $(ARCH)/$@; fi
lib/%/libtcc1.a : FORCE $(PROGS_CROSS) lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
$(MAKE) -C lib cross TARGET=$* $(MAKE) -C ../lib cross TARGET=$*
FORCE: FORCE:
@ -360,21 +360,21 @@ uninstall:
endif endif
# documentation and man page # documentation and man page
tcc-doc.html: tcc-doc.texi tcc-doc.html: ../docs/tcc-doc.texi
-makeinfo --no-split --html --number-sections -o $@ $< -makeinfo --no-split --html --number-sections -o $@ $<
tcc.1: tcc-doc.texi tcc.1: ../docs/tcc-doc.texi
-$(top_srcdir)/texi2pod.pl $< tcc.pod -$(top_srcdir)/texi2pod.pl $< tcc.pod
-pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/VERSION` tcc.pod > $@ -pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/../VERSION` tcc.pod > $@
tcc-doc.info: tcc-doc.texi tcc-doc.info: ../docs/tcc-doc.texi
-makeinfo $< -makeinfo $<
# in tests subdir # in tests subdir
export LIBTCC1 export LIBTCC1
%est: %est:
$(MAKE) -C tests $@ 'PROGS_CROSS=$(PROGS_CROSS)' $(MAKE) -C ../tests $@ 'PROGS_CROSS=$(PROGS_CROSS)'
clean: clean:
rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.log \ rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.log \
@ -384,9 +384,9 @@ ifeq ($(HOST_OS),Linux)
-rm -r ./C: -rm -r ./C:
endif endif
-rm *-tcc$(EXESUF) -rm *-tcc$(EXESUF)
$(MAKE) -C tests $@ $(MAKE) -C ../tests $@
ifneq ($(LIBTCC1),) ifneq ($(LIBTCC1),)
$(MAKE) -C lib $@ $(MAKE) -C ../lib $@
endif endif
distclean: clean distclean: clean
@ -404,7 +404,7 @@ TAGS:
# create release tarball from *current* git branch (including tcc-doc.html # create release tarball from *current* git branch (including tcc-doc.html
# and converting two files to CRLF) # and converting two files to CRLF)
TCC-VERSION := tcc-$(shell cat $(top_srcdir)/VERSION) TCC-VERSION := tcc-$(shell cat $(top_srcdir)/../VERSION)
tar: tcc-doc.html tar: tcc-doc.html
mkdir $(TCC-VERSION) mkdir $(TCC-VERSION)
( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f ) ( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f )

View File

@ -151,7 +151,7 @@ enum float_abi {
/******************************************************/ /******************************************************/
#else /* ! TARGET_DEFS_ONLY */ #else /* ! TARGET_DEFS_ONLY */
/******************************************************/ /******************************************************/
#include "tcc.h" #include "../tcc.h"
enum float_abi float_abi; enum float_abi float_abi;

View File

@ -58,7 +58,7 @@ typedef int RegArgs;
/******************************************************/ /******************************************************/
#else /* ! TARGET_DEFS_ONLY */ #else /* ! TARGET_DEFS_ONLY */
/******************************************************/ /******************************************************/
#include "tcc.h" #include "../tcc.h"
#include <assert.h> #include <assert.h>
ST_DATA const int reg_classes[NB_REGS] = { ST_DATA const int reg_classes[NB_REGS] = {

View File

View File

View File

@ -40,24 +40,24 @@ ST_DATA struct TCCState *tcc_state;
#include "tccelf.c" #include "tccelf.c"
#include "tccrun.c" #include "tccrun.c"
#ifdef TCC_TARGET_I386 #ifdef TCC_TARGET_I386
#include "i386-gen.c" #include "x86/i386-gen.c"
#endif #endif
#ifdef TCC_TARGET_ARM #ifdef TCC_TARGET_ARM
#include "arm-gen.c" #include "arm/arm-gen.c"
#endif #endif
#ifdef TCC_TARGET_ARM64 #ifdef TCC_TARGET_ARM64
#include "arm64-gen.c" #include "arm/arm64-gen.c"
#endif #endif
#ifdef TCC_TARGET_C67 #ifdef TCC_TARGET_C67
#include "c67-gen.c" #include "tms320c67/c67-gen.c"
#endif #endif
#ifdef TCC_TARGET_X86_64 #ifdef TCC_TARGET_X86_64
#include "x86_64-gen.c" #include "x86/x86_64-gen.c"
#endif #endif
#ifdef CONFIG_TCC_ASM #ifdef CONFIG_TCC_ASM
#include "tccasm.c" #include "tccasm.c"
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
#include "i386-asm.c" #include "x86/i386-asm.c"
#endif #endif
#endif #endif
#ifdef TCC_TARGET_COFF #ifdef TCC_TARGET_COFF

View File

View File

View File

@ -293,20 +293,20 @@
#define TARGET_DEFS_ONLY #define TARGET_DEFS_ONLY
#ifdef TCC_TARGET_I386 #ifdef TCC_TARGET_I386
# include "i386-gen.c" # include "x86/i386-gen.c"
#endif #endif
#ifdef TCC_TARGET_X86_64 #ifdef TCC_TARGET_X86_64
# include "x86_64-gen.c" # include "x86/x86_64-gen.c"
#endif #endif
#ifdef TCC_TARGET_ARM #ifdef TCC_TARGET_ARM
# include "arm-gen.c" # include "arm/arm-gen.c"
#endif #endif
#ifdef TCC_TARGET_ARM64 #ifdef TCC_TARGET_ARM64
# include "arm64-gen.c" # include "arm/arm64-gen.c"
#endif #endif
#ifdef TCC_TARGET_C67 #ifdef TCC_TARGET_C67
# include "coff.h" # include "coff.h"
# include "c67-gen.c" # include "tms320c67c67-gen.c"
#endif #endif
#undef TARGET_DEFS_ONLY #undef TARGET_DEFS_ONLY

View File

@ -1549,7 +1549,7 @@ static int tcc_add_support(TCCState *s1, const char *filename)
"i386" "i386"
#endif #endif
#ifdef TCC_TARGET_X86_64 #ifdef TCC_TARGET_X86_64
"x86-64" "x86_64"
#endif #endif
#ifdef TCC_TARGET_ARM #ifdef TCC_TARGET_ARM
"arm" "arm"

View File

@ -1636,7 +1636,7 @@ quit:
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
#define TINY_IMPDEF_GET_EXPORT_NAMES_ONLY #define TINY_IMPDEF_GET_EXPORT_NAMES_ONLY
#include "win32/tools/tiny_impdef.c" #include "../win32/tools/tiny_impdef.c"
static int pe_load_dll(TCCState *s1, const char *dllname, int fd) static int pe_load_dll(TCCState *s1, const char *dllname, int fd)
{ {

View File

@ -331,5 +331,5 @@
#endif #endif
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
#include "i386-tok.h" #include "x86/i386-tok.h"
#endif #endif

View File

@ -127,7 +127,7 @@ enum {
/******************************************************/ /******************************************************/
#else /* ! TARGET_DEFS_ONLY */ #else /* ! TARGET_DEFS_ONLY */
/******************************************************/ /******************************************************/
#include "tcc.h" #include "../tcc.h"
ST_DATA const int reg_classes[NB_REGS] = { ST_DATA const int reg_classes[NB_REGS] = {
/* eax */ RC_INT | RC_FLOAT | RC_EAX, /* eax */ RC_INT | RC_FLOAT | RC_EAX,

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "tcc.h" #include "../tcc.h"
/* #define NB_ASM_REGS 8 */ /* #define NB_ASM_REGS 8 */
#define MAX_OPERANDS 3 #define MAX_OPERANDS 3

View File

@ -89,7 +89,7 @@ enum {
/******************************************************/ /******************************************************/
#else /* ! TARGET_DEFS_ONLY */ #else /* ! TARGET_DEFS_ONLY */
/******************************************************/ /******************************************************/
#include "tcc.h" #include "../tcc.h"
ST_DATA const int reg_classes[NB_REGS] = { ST_DATA const int reg_classes[NB_REGS] = {
/* eax */ RC_INT | RC_EAX, /* eax */ RC_INT | RC_EAX,

View File

@ -136,7 +136,7 @@ enum {
/******************************************************/ /******************************************************/
#else /* ! TARGET_DEFS_ONLY */ #else /* ! TARGET_DEFS_ONLY */
/******************************************************/ /******************************************************/
#include "tcc.h" #include "../tcc.h"
#include <assert.h> #include <assert.h>
ST_DATA const int reg_classes[NB_REGS] = { ST_DATA const int reg_classes[NB_REGS] = {

View File

@ -2,7 +2,7 @@
# Tiny C Compiler Makefile - tests # Tiny C Compiler Makefile - tests
# #
TOP = .. TOP = ../src
include $(TOP)/Makefile include $(TOP)/Makefile
SRCDIR = $(top_srcdir)/tests SRCDIR = $(top_srcdir)/tests
VPATH = $(SRCDIR) $(top_srcdir) VPATH = $(SRCDIR) $(top_srcdir)
@ -60,11 +60,11 @@ ifeq ($(TARGETOS),Darwin)
endif endif
# run local version of tcc with local libraries and includes # run local version of tcc with local libraries and includes
TCCFLAGS = -B$(TOP) -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP) TCCFLAGS = -B$(TOP)/../lib -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/../include -L$(TOP)
ifdef CONFIG_WIN32 ifdef CONFIG_WIN32
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP) TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/../include -L$(TOP)
endif endif
XTCCFLAGS = -B$(TOP) -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include XTCCFLAGS = -B$(TOP)/../lib -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/../include
TCC = $(TOP)/tcc $(TCCFLAGS) TCC = $(TOP)/tcc $(TCCFLAGS)
RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS) RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS)
@ -73,7 +73,7 @@ DISAS = objdump -d
# libtcc test # libtcc test
ifdef LIBTCC1 ifdef LIBTCC1
LIBTCC1:=$(TOP)/$(LIBTCC1) LIBTCC1:=$(TOP)/lib/$(LIBTCC1)
endif endif
all test : $(TESTS) all test : $(TESTS)

View File

@ -2,7 +2,7 @@
# credits: 01..13.c from the pcc cpp-tests suite # credits: 01..13.c from the pcc cpp-tests suite
# #
TCC = ../../tcc TCC = ../../src/tcc
TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) TESTS = $(patsubst %.c,%.test,$(wildcard *.c))
all test : $(TESTS) all test : $(TESTS)

View File

@ -1,4 +1,4 @@
TOP = ../.. TOP = ../../src
include $(TOP)/Makefile include $(TOP)/Makefile
# clear CFLAGS and LDFLAGS # clear CFLAGS and LDFLAGS
@ -6,9 +6,9 @@ CFLAGS :=
LDFLAGS := LDFLAGS :=
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 else
TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm TCCFLAGS = -B$(TOP)/../lib -I$(top_srcdir)/../include -lm
endif endif
ifeq ($(TARGETOS),Darwin) ifeq ($(TARGETOS),Darwin)

View File

@ -21,7 +21,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../../elf.h" #include "../../src/elf.h"
#ifdef TCC_TARGET_X86_64 #ifdef TCC_TARGET_X86_64
# define ELFCLASSW ELFCLASS64 # define ELFCLASSW ELFCLASS64