* 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...
Unified · Split
| @@ -5,7 +5,7 @@ a.out · 4 unmodified lines | |||
| 5 | *.log | 5 | *.log |
| 6 | tcc_g | 6 | tcc_g |
| 7 | tcc | 7 | tcc |
| 8 | /*-tcc | 8 | /src/*-tcc |
| 9 | tc2.c | 9 | tc2.c |
| 10 | doc | 10 | doc |
| 11 | tc3s.c | 11 | tc3s.c |
| @@ -63,7 +63,7 @@ lib/i386-win32 · 51 unmodified lines | |||
| 63 | lib/arm | 63 | lib/arm |
| 64 | lib/arm64 | 64 | lib/arm64 |
| 65 | tcc-doc.info | 65 | tcc-doc.info |
| 66 | conftest* | 66 | conftest*!conftest.c |
| 67 | tiny_libmaker | 67 | tiny_libmaker |
| 68 | *.dSYM | 68 | *.dSYM |
| 69 | *~ | 69 | *~ |
| @@ -85,14 +85,14 @@ endif() · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | file(STRINGS "VERSION" TCC_VERSION) | 86 | file(STRINGS "VERSION" TCC_VERSION) |
| 87 | list(GET TCC_VERSION 0 TCC_VERSION) | 87 | list(GET TCC_VERSION 0 TCC_VERSION) |
| 88 | include_directories(${CMAKE_BINARY_DIR}) | 88 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/) |
| 89 | configure_file(config.h.in config.h) | 89 | configure_file(src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h) |
| 90 | configure_file(config.texi.in config.texi) | 90 | configure_file(docs/config.texi.in ${CMAKE_CURRENT_SOURCE_DIR}/docs/config.texi) |
| 91 | 91 | ||
| 92 | # Utility variables | 92 | # Utility variables |
| 93 | set(I386_SOURCES i386-gen.c i386-asm.c i386-asm.h i386-tok.h) | 93 | set(I386_SOURCES src/x86/i386-gen.c src/x86/i386-asm.c src/x86/i386-asm.h src/x86/i386-tok.h) |
| 94 | set(X86_64_SOURCES x86_64-gen.c i386-asm.c x86_64-asm.h) | 94 | set(X86_64_SOURCES src/x86/x86_64-gen.c src/x86/i386-asm.c src/x86/x86_64-asm.h) |
| 95 | set(ARM_SOURCES arm_gen.c) | 95 | set(ARM_SOURCES src/arm/arm_gen.c) |
| 96 | 96 | ||
| 97 | set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S) | 97 | set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S) |
| 98 | set(LIBTCC1_WIN_SOURCES win32/lib/crt1.c win32/lib/wincrt1.c win32/lib/dllcrt1.c win32/lib/dllmain.c win32/lib/chkstk.S) | 98 | 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 · 58 unmodified lines | |||
| 157 | 157 | ||
| 158 | if (TCC_BUILD_NATIVE) | 158 | if (TCC_BUILD_NATIVE) |
| 159 | add_library(libtcc | 159 | add_library(libtcc |
| 160 | libtcc.c | 160 | src/libtcc.c |
| 161 | tccpp.c | 161 | src/tccpp.c |
| 162 | tccgen.c | 162 | src/tccgen.c |
| 163 | tccelf.c | 163 | src/tccelf.c |
| 164 | tccasm.c | 164 | src/tccasm.c |
| 165 | tccrun.c | 165 | src/tccrun.c |
| 166 | tcc.h | 166 | src/tcc.h |
| 167 | libtcc.h | 167 | src/libtcc.h |
| 168 | tcctok.h | 168 | src/tcctok.h |
| 169 | ${tcc_sources} | 169 | ${tcc_sources} |
| 170 | ) | 170 | ) |
| 171 | set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib) | 171 | set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib) |
| 172 | if(WIN32) | 172 | if(WIN32) |
| 173 | set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def") | 173 | set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def") |
| 174 | endif() | 174 | endif() |
| 175 | add_executable(tcc tcc.c) | 175 | add_executable(tcc src/tcc.c) |
| 176 | target_link_libraries(tcc libtcc) | 176 | target_link_libraries(tcc libtcc) |
| 177 | if(NOT WIN32) | 177 | if(NOT WIN32) |
| 178 | target_link_libraries(tcc dl) | 178 | target_link_libraries(tcc dl) |
| @@ -185,7 +185,7 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt · 6 unmodified lines | |||
| 185 | endif() | 185 | endif() |
| 186 | endif() | 186 | endif() |
| 187 | elseif(${cross_enabled}) | 187 | elseif(${cross_enabled}) |
| 188 | add_executable(${cross_name}-tcc tcc.c) | 188 | add_executable(${cross_name}-tcc src/tcc.c) |
| 189 | set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}") | 189 | set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}") |
| 190 | install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH}) | 190 | install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH}) |
| 191 | 191 | ||
| @@ -197,17 +197,17 @@ endmacro() · 5 unmodified lines | |||
| 197 | 197 | ||
| 198 | make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32 | 198 | make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32 |
| 199 | "TCC_TARGET_I386;TCC_TARGET_PE" | 199 | "TCC_TARGET_I386;TCC_TARGET_PE" |
| 200 | "${I386_SOURCES};tccpe.c" | 200 | "${I386_SOURCES};src/tccpe.c" |
| 201 | tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" | 201 | tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" |
| 202 | ) | 202 | ) |
| 203 | make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64 | 203 | make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64 |
| 204 | "TCC_TARGET_X86_64;TCC_TARGET_PE" | 204 | "TCC_TARGET_X86_64;TCC_TARGET_PE" |
| 205 | "${X86_64_SOURCES};tccpe.c" | 205 | "${X86_64_SOURCES};src/tccpe.c" |
| 206 | tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" | 206 | tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" |
| 207 | ) | 207 | ) |
| 208 | make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE | 208 | make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE |
| 209 | "TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE" | 209 | "TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE" |
| 210 | "${ARM_SOURCES};tccpe.c" | 210 | "${ARM_SOURCES};src/tccpe.c" |
| 211 | "" "" "" | 211 | "" "" "" |
| 212 | ) | 212 | ) |
| 213 | make_tcc("i386" i386-linux-gnu TCC_BUILD_I386 | 213 | make_tcc("i386" i386-linux-gnu TCC_BUILD_I386 |
| @@ -248,7 +248,7 @@ make_tcc("" arm-linux-gnu TCC_BUILD_ARM_VFP · 34 unmodified lines | |||
| 248 | ) | 248 | ) |
| 249 | make_tcc("" c67 TCC_BUILD_C67 | 249 | make_tcc("" c67 TCC_BUILD_C67 |
| 250 | TCC_TARGET_C67 | 250 | TCC_TARGET_C67 |
| 251 | "c67-gen.c;tcccoff.c" | 251 | "c67-gen.c;src/tcccoff.c" |
| 252 | "" "" "" | 252 | "" "" "" |
| 253 | ) | 253 | ) |
| 254 | 254 | ||
| @@ -257,14 +257,14 @@ add_subdirectory(tests) · 2 unmodified lines | |||
| 257 | find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin) | 257 | find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin) |
| 258 | if(MAKEINFO) | 258 | if(MAKEINFO) |
| 259 | add_custom_command(OUTPUT tcc-doc.html | 259 | add_custom_command(OUTPUT tcc-doc.html |
| 260 | COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | 260 | COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi |
| 261 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | 261 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi |
| 262 | ) | 262 | ) |
| 263 | set(TCC_DOC_FILES tcc-doc.html) | 263 | set(TCC_DOC_FILES tcc-doc.html) |
| 264 | if(NOT WIN32) | 264 | if(NOT WIN32) |
| 265 | add_custom_command(OUTPUT tcc-doc.info | 265 | add_custom_command(OUTPUT tcc-doc.info |
| 266 | COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | 266 | COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi |
| 267 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | 267 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/docs/tcc-doc.texi |
| 268 | ) | 268 | ) |
| 269 | set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info) | 269 | set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info) |
| 270 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info) | 270 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info) |
| @@ -290,4 +290,3 @@ else() · 19 unmodified lines | |||
| 290 | install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include) | 290 | install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include) |
| 291 | install(DIRECTORY include/ DESTINATION lib/tcc/win32/include) | 291 | install(DIRECTORY include/ DESTINATION lib/tcc/win32/include) |
| 292 | endif() | 292 | endif() |
| 293 | |||
| @@ -337,7 +337,7 @@ strip="${cross_prefix}${strip}" · 336 unmodified lines | |||
| 337 | CONFTEST=./conftest$EXESUF | 337 | CONFTEST=./conftest$EXESUF |
| 338 | 338 | ||
| 339 | if test -z "$cross_prefix" ; then | 339 | if test -z "$cross_prefix" ; then |
| 340 | if ! $cc -o $CONFTEST $source_path/conftest.c 2>/dev/null ; then | 340 | if ! $cc -o $CONFTEST $source_path/src/conftest.c 2>/dev/null ; then |
| 341 | echo "configure: error: '$cc' failed to compile conftest.c." | 341 | echo "configure: error: '$cc' failed to compile conftest.c." |
| 342 | else | 342 | else |
| 343 | bigendian="$($CONFTEST bigendian)" | 343 | bigendian="$($CONFTEST bigendian)" |
| @@ -560,7 +560,7 @@ fi · 216 unmodified lines | |||
| 560 | version=`head $source_path/VERSION` | 560 | version=`head $source_path/VERSION` |
| 561 | echo "VERSION=$version" >>config.mak | 561 | echo "VERSION=$version" >>config.mak |
| 562 | echo "#define TCC_VERSION \"$version\"" >> $TMPH | 562 | echo "#define TCC_VERSION \"$version\"" >> $TMPH |
| 563 | echo "@set VERSION $version" > config.texi | 563 | echo "@set VERSION $version" >docs/config.texi |
| 564 | echo "SRC_PATH=$source_path" >>config.mak | 564 | echo "SRC_PATH=$source_path" >>config.mak |
| 565 | 565 | ||
| 566 | if test "$source_path_used" = "yes" ; then | 566 | if test "$source_path_used" = "yes" ; then |
| @@ -573,9 +573,9 @@ else · 6 unmodified lines | |||
| 573 | fi | 573 | fi |
| 574 | echo 'top_builddir=$(TOP)' >>config.mak | 574 | echo 'top_builddir=$(TOP)' >>config.mak |
| 575 | 575 | ||
| 576 | diff $TMPH config.h >/dev/null 2>&1 | 576 | diff $TMPH src/config.h >/dev/null 2>&1 |
| 577 | if test $? -ne 0 ; then | 577 | if test $? -ne 0 ; then |
| 578 | mv -f $TMPH config.h | 578 | mv -f $TMPH src/config.h |
| 579 | else | 579 | else |
| 580 | echo "config.h is unchanged" | 580 | echo "config.h is unchanged" |
| 581 | fi | 581 | fi |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File mode changed from 100755 to 100644.
| @@ -2,9 +2,9 @@ · 1 unmodified line | |||
| 2 | # Tiny C Compiler Makefile for libtcc1.a | 2 | # Tiny C Compiler Makefile for libtcc1.a |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | TOP = .. | 5 | TOP = ../src |
| 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 # native library | 9 | ifndef TARGET # native library |
| 10 | ifdef CONFIG_WIN64 | 10 | ifdef CONFIG_WIN64 |
| @@ -37,7 +37,7 @@ endif · 26 unmodified lines | |||
| 37 | BCHECK_O = bcheck.o | 37 | BCHECK_O = bcheck.o |
| 38 | DIR = $(TARGET) | 38 | DIR = $(TARGET) |
| 39 | 39 | ||
| 40 | native : ../libtcc1.a | 40 | native : $(DIR)/libtcc1.a |
| 41 | cross : $(DIR)/libtcc1.a | 41 | cross : $(DIR)/libtcc1.a |
| 42 | 42 | ||
| 43 | native : TCC = $(TOP)/tcc$(EXESUF) | 43 | native : TCC = $(TOP)/tcc$(EXESUF) |
| @@ -61,26 +61,26 @@ CFLAGS := $(filter-out -fstack-protector-strong,$(CFLAGS)) · 17 unmodified lines | |||
| 61 | ifeq "$(TARGET)" "i386-win" | 61 | ifeq "$(TARGET)" "i386-win" |
| 62 | OBJ = $(addprefix $(DIR)/,$(WIN32_O)) | 62 | OBJ = $(addprefix $(DIR)/,$(WIN32_O)) |
| 63 | TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE | 63 | TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE |
| 64 | XCC ?= $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include | 64 | XCC ?= $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/../include |
| 65 | XAR ?= $(DIR)/tiny_libmaker$(EXESUF) | 65 | XAR ?= $(DIR)/tiny_libmaker$(EXESUF) |
| 66 | PICFLAGS = | 66 | PICFLAGS = |
| 67 | else | 67 | else |
| 68 | ifeq "$(TARGET)" "x86_64-win" | 68 | ifeq "$(TARGET)" "x86_64-win" |
| 69 | OBJ = $(addprefix $(DIR)/,$(WIN64_O)) | 69 | OBJ = $(addprefix $(DIR)/,$(WIN64_O)) |
| 70 | TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE | 70 | TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE |
| 71 | XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include | 71 | XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/../include |
| 72 | XAR ?= $(DIR)/tiny_libmaker$(EXESUF) | 72 | XAR ?= $(DIR)/tiny_libmaker$(EXESUF) |
| 73 | PICFLAGS = | 73 | PICFLAGS = |
| 74 | else | 74 | else |
| 75 | ifeq "$(TARGET)" "i386" | 75 | ifeq "$(TARGET)" "i386" |
| 76 | OBJ = $(addprefix $(DIR)/,$(I386_O)) | 76 | OBJ = $(addprefix $(DIR)/,$(I386_O)) |
| 77 | TGT = -DTCC_TARGET_I386 | 77 | TGT = -DTCC_TARGET_I386 |
| 78 | XCC ?= $(TCC) -B$(TOP) | 78 | XCC ?= $(TCC) -B$(TOP) -I$(top_srcdir)/../include |
| 79 | else | 79 | else |
| 80 | ifeq "$(TARGET)" "x86_64" | 80 | ifeq "$(TARGET)" "x86_64" |
| 81 | OBJ = $(addprefix $(DIR)/,$(X86_64_O)) | 81 | OBJ = $(addprefix $(DIR)/,$(X86_64_O)) |
| 82 | TGT = -DTCC_TARGET_X86_64 | 82 | TGT = -DTCC_TARGET_X86_64 |
| 83 | XCC ?= $(TCC) -B$(TOP) | 83 | XCC ?= $(TCC) -B$(TOP) -I$(top_srcdir)/../include |
| 84 | else | 84 | else |
| 85 | ifeq "$(TARGET)" "arm" | 85 | ifeq "$(TARGET)" "arm" |
| 86 | OBJ = $(addprefix $(DIR)/,$(ARM_O)) | 86 | OBJ = $(addprefix $(DIR)/,$(ARM_O)) |
| @@ -110,7 +110,7 @@ endif · 23 unmodified lines | |||
| 110 | 110 | ||
| 111 | XAR ?= $(AR) | 111 | XAR ?= $(AR) |
| 112 | 112 | ||
| 113 | $(DIR)/libtcc1.a ../libtcc1.a : $(OBJ) $(XAR) | 113 | $(DIR)/libtcc1.a : $(OBJ) $(XAR) |
| 114 | $(XAR) rcs $@ $(OBJ) | 114 | $(XAR) rcs $@ $(OBJ) |
| 115 | $(DIR)/%.o : %.c | 115 | $(DIR)/%.o : %.c |
| 116 | $(XCC) -c $< -o $@ $(XFLAGS) | 116 | $(XCC) -c $< -o $@ $(XFLAGS) |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | TOP ?= . | 5 | TOP ?= . |
| 6 | include $(TOP)/config.mak | 6 | include $(TOP)/../config.mak |
| 7 | VPATH = $(top_srcdir) | 7 | VPATH = $(top_srcdir) |
| 8 | 8 | ||
| 9 | CPPFLAGS += -I$(TOP) # for config.h | 9 | CPPFLAGS += -I$(TOP) # for config.h |
| @@ -113,14 +113,14 @@ endif · 103 unmodified lines | |||
| 113 | 113 | ||
| 114 | CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c | 114 | CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c |
| 115 | CORE_FILES += tcc.h config.h libtcc.h tcctok.h | 115 | CORE_FILES += tcc.h config.h libtcc.h tcctok.h |
| 116 | I386_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h | 116 | I386_FILES = $(CORE_FILES) x86/i386-gen.c x86/i386-asm.c x86/i386-asm.h x86/i386-tok.h |
| 117 | WIN32_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h tccpe.c | 117 | WIN32_FILES = $(CORE_FILES) x86/i386-gen.c x86/i386-asm.c x86/i386-asm.h x86/i386-tok.h tccpe.c |
| 118 | WIN64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h tccpe.c | 118 | WIN64_FILES = $(CORE_FILES) x86/x86_64-gen.c x86/i386-asm.c x86/x86_64-asm.h tccpe.c |
| 119 | WINCE_FILES = $(CORE_FILES) arm-gen.c tccpe.c | 119 | WINCE_FILES = $(CORE_FILES) arm/arm-gen.c tccpe.c |
| 120 | X86_64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h | 120 | X86_64_FILES = $(CORE_FILES) x86/x86_64-gen.c x86/i386-asm.c x86/x86_64-asm.h |
| 121 | ARM_FILES = $(CORE_FILES) arm-gen.c | 121 | ARM_FILES = $(CORE_FILES) arm/arm-gen.c |
| 122 | ARM64_FILES = $(CORE_FILES) arm64-gen.c | 122 | ARM64_FILES = $(CORE_FILES) arm/arm64-gen.c |
| 123 | C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c | 123 | C67_FILES = $(CORE_FILES) tms320c67/c67-gen.c tcccoff.c |
| 124 | 124 | ||
| 125 | ifdef CONFIG_WIN64 | 125 | ifdef CONFIG_WIN64 |
| 126 | PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF) | 126 | PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF) |
| @@ -249,18 +249,18 @@ libtcc.dll libtcc.def libtcc.a: $(LIBTCC_OBJ) · 122 unmodified lines | |||
| 249 | endif | 249 | endif |
| 250 | 250 | ||
| 251 | # windows utilities | 251 | # windows utilities |
| 252 | tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c | 252 | tiny_impdef$(EXESUF): ../win32/tools/tiny_impdef.c |
| 253 | $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) | 253 | $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) |
| 254 | tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c | 254 | tiny_libmaker$(EXESUF): ../win32/tools/tiny_libmaker.c |
| 255 | $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) | 255 | $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) |
| 256 | 256 | ||
| 257 | # TinyCC runtime libraries | 257 | # TinyCC runtime libraries |
| 258 | libtcc1.a : FORCE | 258 | libtcc1.a : FORCE |
| 259 | $(MAKE) -C lib native | 259 | $(MAKE) -C ../lib native |
| 260 | if test ! -d $(ARCH); then mkdir $(ARCH); fi | 260 | if test ! -d $(ARCH); then mkdir $(ARCH); fi |
| 261 | if test ! -L $(ARCH)/$@; then ln -sf ../$@ $(ARCH)/$@; fi | 261 | if test ! -L $(ARCH)/$@; then ln -sf ../$@ $(ARCH)/$@; fi |
| 262 | lib/%/libtcc1.a : FORCE $(PROGS_CROSS) | 262 | lib/%/libtcc1.a : FORCE $(PROGS_CROSS) |
| 263 | $(MAKE) -C lib cross TARGET=$* | 263 | $(MAKE) -C ../lib cross TARGET=$* |
| 264 | 264 | ||
| 265 | FORCE: | 265 | FORCE: |
| 266 | 266 | ||
| @@ -360,21 +360,21 @@ uninstall: · 93 unmodified lines | |||
| 360 | endif | 360 | endif |
| 361 | 361 | ||
| 362 | # documentation and man page | 362 | # documentation and man page |
| 363 | tcc-doc.html: tcc-doc.texi | 363 | tcc-doc.html: ../docs/tcc-doc.texi |
| 364 | -makeinfo --no-split --html --number-sections -o $@ $< | 364 | -makeinfo --no-split --html --number-sections -o $@ $< |
| 365 | 365 | ||
| 366 | tcc.1: tcc-doc.texi | 366 | tcc.1: ../docs/tcc-doc.texi |
| 367 | -$(top_srcdir)/texi2pod.pl $< tcc.pod | 367 | -$(top_srcdir)/texi2pod.pl $< tcc.pod |
| 368 | -pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/VERSION` tcc.pod > $@ | 368 | -pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/../VERSION` tcc.pod > $@ |
| 369 | 369 | ||
| 370 | tcc-doc.info: tcc-doc.texi | 370 | tcc-doc.info: ../docs/tcc-doc.texi |
| 371 | -makeinfo $< | 371 | -makeinfo $< |
| 372 | 372 | ||
| 373 | # in tests subdir | 373 | # in tests subdir |
| 374 | export LIBTCC1 | 374 | export LIBTCC1 |
| 375 | 375 | ||
| 376 | %est: | 376 | %est: |
| 377 | $(MAKE) -C tests $@ 'PROGS_CROSS=$(PROGS_CROSS)' | 377 | $(MAKE) -C ../tests $@ 'PROGS_CROSS=$(PROGS_CROSS)' |
| 378 | 378 | ||
| 379 | clean: | 379 | clean: |
| 380 | rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.log \ | 380 | rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.log \ |
| @@ -384,9 +384,9 @@ ifeq ($(HOST_OS),Linux) · 3 unmodified lines | |||
| 384 | -rm -r ./C: | 384 | -rm -r ./C: |
| 385 | endif | 385 | endif |
| 386 | -rm *-tcc$(EXESUF) | 386 | -rm *-tcc$(EXESUF) |
| 387 | $(MAKE) -C tests $@ | 387 | $(MAKE) -C ../tests $@ |
| 388 | ifneq ($(LIBTCC1),) | 388 | ifneq ($(LIBTCC1),) |
| 389 | $(MAKE) -C lib $@ | 389 | $(MAKE) -C ../lib $@ |
| 390 | endif | 390 | endif |
| 391 | 391 | ||
| 392 | distclean: clean | 392 | distclean: clean |
| @@ -404,7 +404,7 @@ TAGS: · 11 unmodified lines | |||
| 404 | 404 | ||
| 405 | # create release tarball from *current* git branch (including tcc-doc.html | 405 | # create release tarball from *current* git branch (including tcc-doc.html |
| 406 | # and converting two files to CRLF) | 406 | # and converting two files to CRLF) |
| 407 | TCC-VERSION := tcc-$(shell cat $(top_srcdir)/VERSION) | 407 | TCC-VERSION := tcc-$(shell cat $(top_srcdir)/../VERSION) |
| 408 | tar: tcc-doc.html | 408 | tar: tcc-doc.html |
| 409 | mkdir $(TCC-VERSION) | 409 | mkdir $(TCC-VERSION) |
| 410 | ( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f ) | 410 | ( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f ) |
| @@ -151,7 +151,7 @@ enum float_abi { · 150 unmodified lines | |||
| 151 | /******************************************************/ | 151 | /******************************************************/ |
| 152 | #else /* ! TARGET_DEFS_ONLY */ | 152 | #else /* ! TARGET_DEFS_ONLY */ |
| 153 | /******************************************************/ | 153 | /******************************************************/ |
| 154 | #include "tcc.h" | 154 | #include "../tcc.h" |
| 155 | 155 | ||
| 156 | enum float_abi float_abi; | 156 | enum float_abi float_abi; |
| 157 | 157 | ||
| @@ -58,7 +58,7 @@ typedef int RegArgs; · 57 unmodified lines | |||
| 58 | /******************************************************/ | 58 | /******************************************************/ |
| 59 | #else /* ! TARGET_DEFS_ONLY */ | 59 | #else /* ! TARGET_DEFS_ONLY */ |
| 60 | /******************************************************/ | 60 | /******************************************************/ |
| 61 | #include "tcc.h" | 61 | #include "../tcc.h" |
| 62 | #include <assert.h> | 62 | #include <assert.h> |
| 63 | 63 | ||
| 64 | ST_DATA const int reg_classes[NB_REGS] = { | 64 | ST_DATA const int reg_classes[NB_REGS] = { |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -40,24 +40,24 @@ ST_DATA struct TCCState *tcc_state; · 39 unmodified lines | |||
| 40 | #include "tccelf.c" | 40 | #include "tccelf.c" |
| 41 | #include "tccrun.c" | 41 | #include "tccrun.c" |
| 42 | #ifdef TCC_TARGET_I386 | 42 | #ifdef TCC_TARGET_I386 |
| 43 | #include "i386-gen.c" | 43 | #include "x86/i386-gen.c" |
| 44 | #endif | 44 | #endif |
| 45 | #ifdef TCC_TARGET_ARM | 45 | #ifdef TCC_TARGET_ARM |
| 46 | #include "arm-gen.c" | 46 | #include "arm/arm-gen.c" |
| 47 | #endif | 47 | #endif |
| 48 | #ifdef TCC_TARGET_ARM64 | 48 | #ifdef TCC_TARGET_ARM64 |
| 49 | #include "arm64-gen.c" | 49 | #include "arm/arm64-gen.c" |
| 50 | #endif | 50 | #endif |
| 51 | #ifdef TCC_TARGET_C67 | 51 | #ifdef TCC_TARGET_C67 |
| 52 | #include "c67-gen.c" | 52 | #include "tms320c67/c67-gen.c" |
| 53 | #endif | 53 | #endif |
| 54 | #ifdef TCC_TARGET_X86_64 | 54 | #ifdef TCC_TARGET_X86_64 |
| 55 | #include "x86_64-gen.c" | 55 | #include "x86/x86_64-gen.c" |
| 56 | #endif | 56 | #endif |
| 57 | #ifdef CONFIG_TCC_ASM | 57 | #ifdef CONFIG_TCC_ASM |
| 58 | #include "tccasm.c" | 58 | #include "tccasm.c" |
| 59 | #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 | 59 | #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 |
| 60 | #include "i386-asm.c" | 60 | #include "x86/i386-asm.c" |
| 61 | #endif | 61 | #endif |
| 62 | #endif | 62 | #endif |
| 63 | #ifdef TCC_TARGET_COFF | 63 | #ifdef TCC_TARGET_COFF |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -293,20 +293,20 @@ · 292 unmodified lines | |||
| 293 | 293 | ||
| 294 | #define TARGET_DEFS_ONLY | 294 | #define TARGET_DEFS_ONLY |
| 295 | #ifdef TCC_TARGET_I386 | 295 | #ifdef TCC_TARGET_I386 |
| 296 | # include "i386-gen.c" | 296 | # include "x86/i386-gen.c" |
| 297 | #endif | 297 | #endif |
| 298 | #ifdef TCC_TARGET_X86_64 | 298 | #ifdef TCC_TARGET_X86_64 |
| 299 | # include "x86_64-gen.c" | 299 | # include "x86/x86_64-gen.c" |
| 300 | #endif | 300 | #endif |
| 301 | #ifdef TCC_TARGET_ARM | 301 | #ifdef TCC_TARGET_ARM |
| 302 | # include "arm-gen.c" | 302 | # include "arm/arm-gen.c" |
| 303 | #endif | 303 | #endif |
| 304 | #ifdef TCC_TARGET_ARM64 | 304 | #ifdef TCC_TARGET_ARM64 |
| 305 | # include "arm64-gen.c" | 305 | # include "arm/arm64-gen.c" |
| 306 | #endif | 306 | #endif |
| 307 | #ifdef TCC_TARGET_C67 | 307 | #ifdef TCC_TARGET_C67 |
| 308 | # include "coff.h" | 308 | # include "coff.h" |
| 309 | # include "c67-gen.c" | 309 | # include "tms320c67c67-gen.c" |
| 310 | #endif | 310 | #endif |
| 311 | #undef TARGET_DEFS_ONLY | 311 | #undef TARGET_DEFS_ONLY |
| 312 | 312 | ||
File renamed without changes.
File renamed without changes.
| @@ -1549,7 +1549,7 @@ static int tcc_add_support(TCCState *s1, const char *filename) · 1548 unmodified lines | |||
| 1549 | "i386" | 1549 | "i386" |
| 1550 | #endif | 1550 | #endif |
| 1551 | #ifdef TCC_TARGET_X86_64 | 1551 | #ifdef TCC_TARGET_X86_64 |
| 1552 | "x86-64" | 1552 | "x86_64" |
| 1553 | #endif | 1553 | #endif |
| 1554 | #ifdef TCC_TARGET_ARM | 1554 | #ifdef TCC_TARGET_ARM |
| 1555 | "arm" | 1555 | "arm" |
File renamed without changes.
File renamed without changes.
| @@ -1636,7 +1636,7 @@ quit: · 1635 unmodified lines | |||
| 1636 | 1636 | ||
| 1637 | /* ------------------------------------------------------------- */ | 1637 | /* ------------------------------------------------------------- */ |
| 1638 | #define TINY_IMPDEF_GET_EXPORT_NAMES_ONLY | 1638 | #define TINY_IMPDEF_GET_EXPORT_NAMES_ONLY |
| 1639 | #include "win32/tools/tiny_impdef.c" | 1639 | #include "../win32/tools/tiny_impdef.c" |
| 1640 | 1640 | ||
| 1641 | static int pe_load_dll(TCCState *s1, const char *dllname, int fd) | 1641 | static int pe_load_dll(TCCState *s1, const char *dllname, int fd) |
| 1642 | { | 1642 | { |
File renamed without changes.
File renamed without changes.
| @@ -331,5 +331,5 @@ · 330 unmodified lines | |||
| 331 | #endif | 331 | #endif |
| 332 | 332 | ||
| 333 | #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 | 333 | #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 |
| 334 | #include "i386-tok.h" | 334 | #include "x86/i386-tok.h" |
| 335 | #endif | 335 | #endif |
| @@ -127,7 +127,7 @@ enum { · 126 unmodified lines | |||
| 127 | /******************************************************/ | 127 | /******************************************************/ |
| 128 | #else /* ! TARGET_DEFS_ONLY */ | 128 | #else /* ! TARGET_DEFS_ONLY */ |
| 129 | /******************************************************/ | 129 | /******************************************************/ |
| 130 | #include "tcc.h" | 130 | #include "../tcc.h" |
| 131 | 131 | ||
| 132 | ST_DATA const int reg_classes[NB_REGS] = { | 132 | ST_DATA const int reg_classes[NB_REGS] = { |
| 133 | /* eax */ RC_INT | RC_FLOAT | RC_EAX, | 133 | /* eax */ RC_INT | RC_FLOAT | RC_EAX, |
| @@ -19,7 +19,7 @@ · 18 unmodified lines | |||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include "tcc.h" | 22 | #include "../tcc.h" |
| 23 | 23 | ||
| 24 | /* #define NB_ASM_REGS 8 */ | 24 | /* #define NB_ASM_REGS 8 */ |
| 25 | #define MAX_OPERANDS 3 | 25 | #define MAX_OPERANDS 3 |
File renamed without changes.
| @@ -89,7 +89,7 @@ enum { · 88 unmodified lines | |||
| 89 | /******************************************************/ | 89 | /******************************************************/ |
| 90 | #else /* ! TARGET_DEFS_ONLY */ | 90 | #else /* ! TARGET_DEFS_ONLY */ |
| 91 | /******************************************************/ | 91 | /******************************************************/ |
| 92 | #include "tcc.h" | 92 | #include "../tcc.h" |
| 93 | 93 | ||
| 94 | ST_DATA const int reg_classes[NB_REGS] = { | 94 | ST_DATA const int reg_classes[NB_REGS] = { |
| 95 | /* eax */ RC_INT | RC_EAX, | 95 | /* eax */ RC_INT | RC_EAX, |
File renamed without changes.
File renamed without changes.
| @@ -136,7 +136,7 @@ enum { · 135 unmodified lines | |||
| 136 | /******************************************************/ | 136 | /******************************************************/ |
| 137 | #else /* ! TARGET_DEFS_ONLY */ | 137 | #else /* ! TARGET_DEFS_ONLY */ |
| 138 | /******************************************************/ | 138 | /******************************************************/ |
| 139 | #include "tcc.h" | 139 | #include "../tcc.h" |
| 140 | #include <assert.h> | 140 | #include <assert.h> |
| 141 | 141 | ||
| 142 | ST_DATA const int reg_classes[NB_REGS] = { | 142 | ST_DATA const int reg_classes[NB_REGS] = { |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | # Tiny C Compiler Makefile - tests | 2 | # Tiny C Compiler Makefile - tests |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | TOP = .. | 5 | TOP = ../src |
| 6 | include $(TOP)/Makefile | 6 | include $(TOP)/Makefile |
| 7 | SRCDIR = $(top_srcdir)/tests | 7 | SRCDIR = $(top_srcdir)/tests |
| 8 | VPATH = $(SRCDIR) $(top_srcdir) | 8 | VPATH = $(SRCDIR) $(top_srcdir) |
| @@ -60,11 +60,11 @@ ifeq ($(TARGETOS),Darwin) · 51 unmodified lines | |||
| 60 | endif | 60 | endif |
| 61 | 61 | ||
| 62 | # run local version of tcc with local libraries and includes | 62 | # run local version of tcc with local libraries and includes |
| 63 | TCCFLAGS = -B$(TOP) -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP) | 63 | TCCFLAGS = -B$(TOP)/../lib -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/../include -L$(TOP) |
| 64 | ifdef CONFIG_WIN32 | 64 | ifdef CONFIG_WIN32 |
| 65 | TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP) | 65 | TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/../include -L$(TOP) |
| 66 | endif | 66 | endif |
| 67 | XTCCFLAGS = -B$(TOP) -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include | 67 | XTCCFLAGS = -B$(TOP)/../lib -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/../include |
| 68 | 68 | ||
| 69 | TCC = $(TOP)/tcc $(TCCFLAGS) | 69 | TCC = $(TOP)/tcc $(TCCFLAGS) |
| 70 | RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS) | 70 | RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS) |
| @@ -73,7 +73,7 @@ DISAS = objdump -d · 2 unmodified lines | |||
| 73 | 73 | ||
| 74 | # libtcc test | 74 | # libtcc test |
| 75 | ifdef LIBTCC1 | 75 | ifdef LIBTCC1 |
| 76 | LIBTCC1:=$(TOP)/$(LIBTCC1) | 76 | LIBTCC1:=$(TOP)/lib/$(LIBTCC1) |
| 77 | endif | 77 | endif |
| 78 | 78 | ||
| 79 | all test : $(TESTS) | 79 | all test : $(TESTS) |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | # credits: 01..13.c from the pcc cpp-tests suite | 2 | # credits: 01..13.c from the pcc cpp-tests suite |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | TCC = ../../tcc | 5 | TCC = ../../src/tcc |
| 6 | TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) | 6 | TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) |
| 7 | 7 | ||
| 8 | all test : $(TESTS) | 8 | all test : $(TESTS) |
| @@ -1,4 +1,4 @@ | |||
| 1 | TOP = ../.. | 1 | TOP = ../../src |
| 2 | include $(TOP)/Makefile | 2 | include $(TOP)/Makefile |
| 3 | 3 | ||
| 4 | # clear CFLAGS and LDFLAGS | 4 | # clear CFLAGS and LDFLAGS |
| @@ -6,9 +6,9 @@ CFLAGS := · 1 unmodified line | |||
| 6 | LDFLAGS := | 6 | LDFLAGS := |
| 7 | 7 | ||
| 8 | ifdef CONFIG_WIN32 | 8 | ifdef CONFIG_WIN32 |
| 9 | TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP) | 9 | TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/../include -L$(TOP) |
| 10 | else | 10 | else |
| 11 | TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm | 11 | TCCFLAGS = -B$(TOP)/../lib -I$(top_srcdir)/../include -lm |
| 12 | endif | 12 | endif |
| 13 | 13 | ||
| 14 | ifeq ($(TARGETOS),Darwin) | 14 | ifeq ($(TARGETOS),Darwin) |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <stdio.h> | 21 | #include <stdio.h> |
| 22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | #include "../../elf.h" | 24 | #include "../../src/elf.h" |
| 25 | 25 | ||
| 26 | #ifdef TCC_TARGET_X86_64 | 26 | #ifdef TCC_TARGET_X86_64 |
| 27 | # define ELFCLASSW ELFCLASS64 | 27 | # define ELFCLASSW ELFCLASS64 |