X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=GNUmakefile;h=bad078a8859eb2b0265320d2c2b60acd0a948609;hp=951aa6849c461e185f4a83fea5ecc1c597972793;hb=20327d5e219699456e684ed7773bf408a8fb4960;hpb=64ccac3572d12a0c8e4350ddb6a8d15456754cb0 diff --git a/GNUmakefile b/GNUmakefile index 951aa6849c..bad078a885 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,22 +1,47 @@ ifdef CONFIG - VERSION = 0.98 - GIT_LABEL = $(shell git describe --all --long) - + VERSION = 0.99 + GIT_LABEL = $(shell echo `git describe --all`-`git rev-parse HEAD`) BUNDLE = Factor.app + DEBUG ?= 0 + REPRODUCIBLE ?= 0 + + # gmake's default CXX is g++, we prefer c++ + SHELL_CXX = $(shell printenv CXX) + ifeq ($(SHELL_CXX),) + CXX=c++ + else + CXX=$(SHELL_CXX) + endif + + XCODE_PATH ?= /Applications/Xcode.app + MACOSX_32_SDK ?= MacOSX10.11.sdk include $(CONFIG) - CFLAGS = -Wall \ + CFLAGS += -Wall \ + -Wextra \ + -pedantic \ -DFACTOR_VERSION="$(VERSION)" \ -DFACTOR_GIT_LABEL="$(GIT_LABEL)" \ $(SITE_CFLAGS) CXXFLAGS += -std=c++11 - ifdef DEBUG + # SANITIZER=address ./build.sh compile + # address,thread,undefined,leak + ifdef SANITIZER + CFLAGS += -fsanitize=$(SANITIZER) + CXXFLAGS += -fsanitize=$(SANITIZER) + endif + + ifneq ($(DEBUG), 0) CFLAGS += -g -DFACTOR_DEBUG else - CFLAGS += -O3 -g + CFLAGS += -O3 + endif + + ifneq ($(REPRODUCIBLE), 0) + CFLAGS += -DFACTOR_REPRODUCIBLE endif ENGINE = $(DLL_PREFIX)factor$(DLL_SUFFIX)$(DLL_EXTENSION) @@ -42,10 +67,8 @@ ifdef CONFIG vm/entry_points.o \ vm/errors.o \ vm/factor.o \ - vm/free_list.o \ vm/full_collector.o \ vm/gc.o \ - vm/gc_info.o \ vm/image.o \ vm/inline_cache.o \ vm/instruction_operands.o \ @@ -91,8 +114,6 @@ ifdef CONFIG 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/aging_space.hpp \ @@ -100,14 +121,11 @@ ifdef CONFIG vm/data_heap.hpp \ vm/code_heap.hpp \ vm/gc.hpp \ - vm/strings.hpp \ vm/float_bits.hpp \ vm/io.hpp \ vm/image.hpp \ vm/callbacks.hpp \ vm/dispatch.hpp \ - vm/entry_points.hpp \ - vm/safepoints.hpp \ vm/vm.hpp \ vm/allot.hpp \ vm/tagged.hpp \ @@ -116,9 +134,7 @@ ifdef CONFIG vm/generic_arrays.hpp \ vm/callstack.hpp \ vm/slot_visitor.hpp \ - vm/collector.hpp \ vm/to_tenured_collector.hpp \ - vm/full_collector.hpp \ vm/arrays.hpp \ vm/math.hpp \ vm/byte_arrays.hpp \ @@ -137,7 +153,7 @@ ifdef CONFIG endif default: - $(MAKE) `./build-support/factor.sh make-target` + $(MAKE) `./build.sh make-target` help: @echo "Run '$(MAKE)' with one of the following parameters:" @@ -146,22 +162,31 @@ help: @echo "linux-x86-64" @echo "linux-ppc-32" @echo "linux-ppc-64" - @echo "linux-arm" + @echo "linux-arm-64" + @echo "freebsd-x86-32" + @echo "freebsd-x86-64" @echo "macosx-x86-32" @echo "macosx-x86-64" @echo "macosx-x86-fat" + @echo "macosx-arm64" @echo "windows-x86-32" @echo "windows-x86-64" @echo "" @echo "Additional modifiers:" @echo "" @echo "DEBUG=1 compile VM with debugging information" + @echo "REPRODUCIBLE=1 compile VM without timestamp" @echo "SITE_CFLAGS=... additional optimization flags" - @echo "NO_UI=1 don't link with X11 libraries (ignored on Mac OS X)" @echo "X11=1 force link with X11 libraries instead of Cocoa (only on Mac OS X)" ALL = factor factor-ffi-test factor-lib +freebsd-x86-32: + $(MAKE) $(ALL) CONFIG=vm/Config.freebsd.x86.32 + +freebsd-x86-64: + $(MAKE) $(ALL) CONFIG=vm/Config.freebsd.x86.64 + macosx-x86-32: $(MAKE) $(ALL) macosx.app CONFIG=vm/Config.macosx.x86.32 @@ -171,6 +196,15 @@ macosx-x86-64: macosx-x86-fat: $(MAKE) $(ALL) macosx.app CONFIG=vm/Config.macosx.x86.fat +macosx-arm64: + $(MAKE) $(ALL) macosx.app CONFIG=vm/Config.macosx.arm64 + +linux-arm-32: + $(MAKE) $(ALL) CONFIG=vm/Config.linux.arm.32 + +linux-arm-64: + $(MAKE) $(ALL) CONFIG=vm/Config.linux.arm.64 + linux-x86-32: $(MAKE) $(ALL) CONFIG=vm/Config.linux.x86.32 @@ -183,9 +217,6 @@ linux-ppc-32: linux-ppc-64: $(MAKE) $(ALL) CONFIG=vm/Config.linux.ppc.64 -linux-arm: - $(MAKE) $(ALL) CONFIG=vm/Config.linux.arm - windows-x86-32: $(MAKE) $(ALL) CONFIG=vm/Config.windows.x86.32 $(MAKE) factor-console CONFIG=vm/Config.windows.x86.32 @@ -200,7 +231,7 @@ macosx.app: factor mkdir -p $(BUNDLE)/Contents/MacOS mkdir -p $(BUNDLE)/Contents/Frameworks mv $(EXECUTABLE) $(BUNDLE)/Contents/MacOS/factor - ln -s Factor.app/Contents/MacOS/factor ./factor + ln -s $(BUNDLE)/Contents/MacOS/factor ./factor $(ENGINE): $(DLL_OBJS) $(TOOLCHAIN_PREFIX)$(LINKER) $(ENGINE) $(DLL_OBJS) @@ -224,7 +255,7 @@ vm/resources.o: $(TOOLCHAIN_PREFIX)$(WINDRES) vm/factor.rs vm/resources.o vm/ffi_test.o: vm/ffi_test.c - $(TOOLCHAIN_PREFIX)$(CC) -c $(CFLAGS) $(FFI_TEST_CFLAGS) -o $@ $< + $(TOOLCHAIN_PREFIX)$(CC) -c $(CFLAGS) $(FFI_TEST_CFLAGS) -std=c99 -o $@ $< vm/master.hpp.gch: vm/master.hpp $(MASTER_HEADERS) $(TOOLCHAIN_PREFIX)$(CXX) -c -x c++-header $(CFLAGS) $(CXXFLAGS) -o $@ $< @@ -253,3 +284,4 @@ clean: rm -f Factor.app/Contents/Frameworks/libfactor.dylib .PHONY: factor factor-lib factor-console factor-ffi-test tags clean macosx.app +.PHONY: linux-x86-32 linux-x86-64 linux-ppc-32 linux-ppc-64 linux-arm-64 freebsd-x86-32 freebsd-x86-64 macosx-x86-32 macosx-x86-64 macosx-x86-fat macosx-arm64 windows-x86-32 windows-x86-64