Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GNUmakefile: use PCH so compiler goes faster

Also add more accurate dependencies on headers so "make" works right when headers change
  • Loading branch information...
commit 0db777edbbf498b57cfdf83aa2cbc217a10b116c 1 parent ceeb9f3
@jckarter jckarter authored
View
1  .gitignore
@@ -1,5 +1,6 @@
*~
_darcs
+*.gch
*.obj
*.o
*.s
View
79 GNUmakefile
@@ -68,6 +68,75 @@ ifdef CONFIG
vm/vm.o \
vm/words.o
+ MASTER_HEADERS = $(PLAF_MASTER_HEADERS) \
+ vm/layouts.hpp \
+ vm/platform.hpp \
+ vm/primitives.hpp \
+ vm/segments.hpp \
+ vm/gc_info.hpp \
+ vm/contexts.hpp \
+ vm/run.hpp \
+ vm/objects.hpp \
+ vm/counting_profiler.hpp \
+ vm/sampling_profiler.hpp \
+ vm/errors.hpp \
+ vm/bignumint.hpp \
+ vm/bignum.hpp \
+ vm/booleans.hpp \
+ vm/instruction_operands.hpp \
+ vm/code_blocks.hpp \
+ vm/bump_allocator.hpp \
+ vm/bitwise_hacks.hpp \
+ vm/mark_bits.hpp \
+ vm/free_list.hpp \
+ vm/fixup.hpp \
+ vm/tuples.hpp \
+ vm/free_list_allocator.hpp \
+ vm/write_barrier.hpp \
+ vm/object_start_map.hpp \
+ vm/nursery_space.hpp \
+ vm/aging_space.hpp \
+ vm/tenured_space.hpp \
+ vm/data_heap.hpp \
+ vm/code_heap.hpp \
+ vm/gc.hpp \
+ vm/debug.hpp \
+ vm/strings.hpp \
+ vm/words.hpp \
+ vm/float_bits.hpp \
+ vm/io.hpp \
+ vm/image.hpp \
+ vm/alien.hpp \
+ vm/callbacks.hpp \
+ vm/dispatch.hpp \
+ vm/entry_points.hpp \
+ vm/safepoints.hpp \
+ vm/vm.hpp \
+ vm/allot.hpp \
+ vm/tagged.hpp \
+ vm/data_roots.hpp \
+ vm/code_roots.hpp \
+ vm/generic_arrays.hpp \
+ vm/callstack.hpp \
+ vm/slot_visitor.hpp \
+ vm/collector.hpp \
+ vm/copying_collector.hpp \
+ vm/nursery_collector.hpp \
+ vm/aging_collector.hpp \
+ vm/to_tenured_collector.hpp \
+ vm/code_block_visitor.hpp \
+ vm/compaction.hpp \
+ vm/full_collector.hpp \
+ vm/arrays.hpp \
+ vm/math.hpp \
+ vm/byte_arrays.hpp \
+ vm/jit.hpp \
+ vm/quotations.hpp \
+ vm/inline_cache.hpp \
+ vm/mvm.hpp \
+ vm/factor.hpp \
+ vm/utilities.hpp
+
EXE_OBJS = $(PLAF_EXE_OBJS)
FFI_TEST_LIBRARY = libfactor-ffi-test$(SHARED_DLL_EXTENSION)
@@ -165,13 +234,16 @@ vm/resources.o:
vm/ffi_test.o: vm/ffi_test.c
$(TOOLCHAIN_PREFIX)$(CC) -c $(CFLAGS) $(FFI_TEST_CFLAGS) -o $@ $<
-.cpp.o:
+vm/master.hpp.gch: vm/master.hpp $(MASTER_HEADERS)
+ $(TOOLCHAIN_PREFIX)$(CPP) -c -x c++-header $(CFLAGS) -o $@ $<
+
+%.o: %.cpp vm/master.hpp.gch
$(TOOLCHAIN_PREFIX)$(CPP) -c $(CFLAGS) -o $@ $<
-.S.o:
+%.o: %.S
$(TOOLCHAIN_PREFIX)$(CC) -c $(CFLAGS) -o $@ $<
-.mm.o:
+%.o: %.mm vm/master.hpp.gch
$(TOOLCHAIN_PREFIX)$(CPP) -c $(CFLAGS) -o $@ $<
.SUFFIXES: .mm
@@ -179,6 +251,7 @@ vm/ffi_test.o: vm/ffi_test.c
endif
clean:
+ rm -f vm/*.gch
rm -f vm/*.o
rm -f factor.dll
rm -f factor.lib
View
3  vm/Config.arm
@@ -1 +1,2 @@
-
+PLAF_MASTER_HEADERS += \
+ cpu-arm.hpp
View
1  vm/Config.linux
@@ -1,4 +1,5 @@
include vm/Config.unix
PLAF_DLL_OBJS += vm/os-genunix.o vm/os-linux.o vm/mvm-unix.o
+PLAF_MASTER_HEADERS += vm/os-genunix.hpp vm/os-linux.hpp
LIBS = -ldl -lm -lrt -lpthread $(X11_UI_LIBS) -Wl,--export-dynamic
SITE_CFLAGS += -Wl,--no-as-needed
View
1  vm/Config.linux.arm
@@ -1,3 +1,4 @@
include vm/Config.linux
include vm/Config.arm
PLAF_DLL_OBJS += vm/os-linux-arm.o
+PLAF_MASTER_HEADERS += vm/os-linux-arm.hpp
View
1  vm/Config.macosx
@@ -2,6 +2,7 @@ include vm/Config.unix
CFLAGS += -fPIC
PLAF_DLL_OBJS += vm/os-macosx.o vm/mach_signal.o vm/mvm-unix.o
+PLAF_MASTER_HEADERS += vm/os-macosx.hpp vm/mach_signal.hpp
DLL_EXTENSION = .dylib
SHARED_DLL_EXTENSION = .dylib
View
1  vm/Config.unix
@@ -10,6 +10,7 @@ SHARED_FLAG = -shared
PLAF_DLL_OBJS = vm/os-unix.o
PLAF_EXE_OBJS += vm/main-unix.o
+PLAF_MASTER_HEADERS += vm/os-unix.hpp
ifdef NO_UI
X11_UI_LIBS =
View
1  vm/Config.windows
@@ -7,6 +7,7 @@ LIBS = -lm
PLAF_DLL_OBJS += vm/os-windows.o vm/mvm-windows.o
PLAF_EXE_OBJS += vm/resources.o vm/main-windows.o
+PLAF_MASTER_HEADERS += vm/os-windows.hpp vm/mvm-windows.hpp
EXE_SUFFIX=
EXE_EXTENSION=.exe
View
1  vm/Config.windows.x86.32
@@ -1,4 +1,5 @@
PLAF_DLL_OBJS += vm/os-windows-x86.32.o
+PLAF_MASTER_HEADERS += vm/os-windows.32.hpp
DLL_PATH=http://factorcode.org/dlls
WINDRES=windres
include vm/Config.windows
View
1  vm/Config.windows.x86.64
@@ -1,4 +1,5 @@
PLAF_DLL_OBJS += vm/os-windows-x86.64.o
+PLAF_MASTER_HEADERS += vm/os-windows.64.hpp
DLL_PATH=http://factorcode.org/dlls/64
CC=$(WIN64_PATH)-gcc.exe
WINDRES=$(WIN64_PATH)-windres.exe
View
1  vm/Config.x86.32
@@ -1,2 +1,3 @@
PLAF_DLL_OBJS += vm/cpu-x86.o
+PLAF_MASTER_HEADERS += vm/cpu-x86.hpp
View
1  vm/Config.x86.64
@@ -1,2 +1,3 @@
PLAF_DLL_OBJS += vm/cpu-x86.o
+PLAF_MASTER_HEADERS += vm/cpu-x86.hpp
View
1  vm/Config.x86.fat
@@ -1,2 +1,3 @@
PLAF_DLL_OBJS += vm/cpu-x86.o
+PLAF_MASTER_HEADERS += vm/cpu-x86.hpp
Please sign in to comment.
Something went wrong with that request. Please try again.