mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Avoid creating temporary output files
This change also removes the futimens() call on the Landlock Make output file workaround, since it caused problems with commands like fixupobj which modify-in-place. It turns out if a file is opened for writing and then no writes actually occur, then the modified time doesn't change.
This commit is contained in:
parent
4c3ab6d11e
commit
2d64b9994b
15 changed files with 502 additions and 446 deletions
Binary file not shown.
|
@ -27,4 +27,4 @@ o/$(MODE)/%.com.ok: \
|
|||
o/$(MODE)/tool/build/runit.com \
|
||||
o/$(MODE)/tool/build/runitd.com \
|
||||
o/$(MODE)/%.com
|
||||
@$(COMPILE) -ATEST -tT$@ $^ $(HOSTS)
|
||||
@$(COMPILE) -wATEST -tT$@ $^ $(HOSTS)
|
||||
|
|
|
@ -20,15 +20,12 @@ o/%.o: %.s ; @$(COMPILE) -AOBJECTIFY.s $(OBJECTIFY.s) $(
|
|||
o/%.o: o/%.s ; @$(COMPILE) -AOBJECTIFY.s $(OBJECTIFY.s) $(OUTPUT_OPTION) $<
|
||||
o/%.s: %.S ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/%.s: o/%.S ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/%.i: %.S ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/%.o: %.S ; @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
|
||||
o/%.o: o/%.S ; @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
|
||||
o/%.s: %.i ; @$(COMPILE) -ACOMPILE.i $(COMPILE.i) $(OUTPUT_OPTION) $<
|
||||
o/%.s: o/%.i ; @$(COMPILE) -ACOMPILE.i $(COMPILE.i) $(OUTPUT_OPTION) $<
|
||||
o/%.lds: %.lds ; @$(COMPILE) -APREPROCESS $(PREPROCESS.lds) $(OUTPUT_OPTION) $<
|
||||
o/%.inc: %.h ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) -D__ASSEMBLER__ -P $<
|
||||
o/%.greg.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $<
|
||||
o/%.zip.o: o/% ; @$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<
|
||||
o/%.zip.o: o/% ; @$(COMPILE) -wAZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<
|
||||
|
||||
o/$(MODE)/%: o/$(MODE)/%.dbg ; @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
|
||||
o/$(MODE)/%.o: %.s ; @$(COMPILE) -AOBJECTIFY.s $(OBJECTIFY.s) $(OUTPUT_OPTION) $<
|
||||
|
@ -39,32 +36,21 @@ o/$(MODE)/%.o: %.f ; @$(COMPILE) -AOBJECTIFY.f $(OBJECTIFY.f) $(
|
|||
o/$(MODE)/%.o: %.F ; @$(COMPILE) -AOBJECTIFY.F $(OBJECTIFY.F) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.ss: %.c ; @$(COMPILE) -ACOMPILE.c $(COMPILE.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.ss: o/$(MODE)/%.c ; @$(COMPILE) -AOBJECTIFY.s $(COMPILE.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.i: %.S ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.i: %.c ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.i: %.cc ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.i: o/$(MODE)/%.c ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.h: %.c ; @$(COMPILE) -AAMALGAMATE $(PREPROCESS) $(OUTPUT_OPTION) -fdirectives-only -P $<
|
||||
o/$(MODE)/%.h: o/$(MODE)/%.c ; @$(COMPILE) -AAMALGAMATE $(PREPROCESS) $(OUTPUT_OPTION) -fdirectives-only -P $<
|
||||
o/$(MODE)/%.o: %.S ; @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.o: o/$(MODE)/%.S ; @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.s: %.i ; @$(COMPILE) -ACOMPILE.i $(COMPILE.i) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.s: o/$(MODE)/%.i ; @$(COMPILE) -ACOMPILE.i $(COMPILE.i) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.o: %.cc ; @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.lds: %.lds ; @$(COMPILE) -APREPROCESS $(PREPROCESS.lds) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.cxx.o: %.c ; @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) -xc++ $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.greg.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.ansi.o: %.ansi.c ; @$(COMPILE) -AOBJECTIFY.ansi $(OBJECTIFY.ansi.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.ansi.o: %.c ; @$(COMPILE) -AOBJECTIFY.ansi $(OBJECTIFY.ansi.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.c99.o: %.c99.c ; @$(COMPILE) -AOBJECTIFY.c99 $(OBJECTIFY.c99.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.c11.o: %.c11.c ; @$(COMPILE) -AOBJECTIFY.c11 $(OBJECTIFY.c11.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.c2x.o: %.c2x.c ; @$(COMPILE) -AOBJECTIFY.c2x $(OBJECTIFY.c2x.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.initabi.o: %.initabi.c ; @$(COMPILE) -AOBJECTIFY.init $(OBJECTIFY.initabi.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.ncabi.o: %.ncabi.c ; @$(COMPILE) -AOBJECTIFY.nc $(OBJECTIFY.ncabi.c) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.real.o: %.c ; @$(COMPILE) -AOBJECTIFY.real $(OBJECTIFY.real.c) $(OUTPUT_OPTION) $<
|
||||
|
||||
o/$(MODE)/%.runs: o/$(MODE)/% ; @$(COMPILE) -ACHECK -tT$@ $< $(TESTARGS)
|
||||
o/$(MODE)/%.zip.o: % ; @$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%.zip.o: % ; @$(COMPILE) -wAZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%-gcc.asm: %.c ; @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) -S -g0 $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%-gcc.asm: %.cc ; @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.cxx) -S -g0 $(OUTPUT_OPTION) $<
|
||||
o/$(MODE)/%-clang.asm: %.c ; @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) -S -g0 $(OUTPUT_OPTION) $<
|
||||
|
@ -73,66 +59,66 @@ o/$(MODE)/%-clang.asm: CC = $(CLANG)
|
|||
|
||||
o/%.o: %.cc
|
||||
@$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -AFIXUPOBJ -T$@ $(FIXUPOBJ) $@
|
||||
@$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@
|
||||
|
||||
o/%.o: o/%.cc
|
||||
@$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -AFIXUPOBJ -T$@ $(FIXUPOBJ) $@
|
||||
@$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@
|
||||
|
||||
o/$(MODE)/%.o: %.c
|
||||
@$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -AFIXUPOBJ -T$@ $(FIXUPOBJ) $@
|
||||
@$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@
|
||||
|
||||
o/$(MODE)/%.o: o/$(MODE)/%.c
|
||||
@$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -AFIXUPOBJ -T$@ $(FIXUPOBJ) $@
|
||||
@$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@
|
||||
|
||||
o/$(MODE)/%.o: o/$(MODE)/%.cc
|
||||
@$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $<
|
||||
@$(COMPILE) -AFIXUPOBJ -T$@ $(FIXUPOBJ) $@
|
||||
@$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@
|
||||
|
||||
o/%.a:
|
||||
$(file >$(TMPDIR)/$(subst /,_,$@),$^)
|
||||
@$(COMPILE) -AARCHIVE -T$@ $(AR) $(ARFLAGS) $@ @$(TMPDIR)/$(subst /,_,$@)
|
||||
@$(COMPILE) -AARCHIVE -wT$@ $(AR) $(ARFLAGS) $@ @$(TMPDIR)/$(subst /,_,$@)
|
||||
|
||||
o/%.pkg:
|
||||
$(file >$(TMPDIR)/$(subst /,_,$@).args,$(filter %.o,$^))
|
||||
@$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$(TMPDIR)/$(subst /,_,$@)
|
||||
@$(COMPILE) -APACKAGE -wT$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$(TMPDIR)/$(subst /,_,$@)
|
||||
|
||||
o/$(MODE)/%.pkg:
|
||||
$(file >$(TMPDIR)/$(subst /,_,$@),$(filter %.o,$^))
|
||||
@$(COMPILE) -APACKAGE -T$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$(TMPDIR)/$(subst /,_,$@)
|
||||
@$(COMPILE) -APACKAGE -wT$@ $(PKG) $(OUTPUT_OPTION) $(addprefix -d,$(filter %.pkg,$^)) @$(TMPDIR)/$(subst /,_,$@)
|
||||
|
||||
o/$(MODE)/%.o: %.py o/$(MODE)/third_party/python/pyobj.com
|
||||
@$(COMPILE) -APYOBJ o/$(MODE)/third_party/python/pyobj.com $(PYFLAGS) -o $@ $<
|
||||
@$(COMPILE) -wAPYOBJ o/$(MODE)/third_party/python/pyobj.com $(PYFLAGS) -o $@ $<
|
||||
|
||||
o/$(MODE)/%.pyc: %.py o/$(MODE)/third_party/python/pycomp.com
|
||||
@$(COMPILE) -APYCOMP o/$(MODE)/third_party/python/pycomp.com $(PYCFLAGS) -o $@ $<
|
||||
@$(COMPILE) -wAPYCOMP o/$(MODE)/third_party/python/pycomp.com $(PYCFLAGS) -o $@ $<
|
||||
|
||||
o/$(MODE)/%.lua: %.lua o/$(MODE)/third_party/lua/luac.com
|
||||
@$(COMPILE) -ALUAC o/$(MODE)/third_party/lua/luac.com -s -o $@ $<
|
||||
@$(COMPILE) -wALUAC o/$(MODE)/third_party/lua/luac.com -s -o $@ $<
|
||||
|
||||
o/$(MODE)/%.lua.runs: %.lua o/$(MODE)/tool/net/redbean.com
|
||||
@$(COMPILE) -ALUA -tT$@ o/$(MODE)/tool/net/redbean.com $(LUAFLAGS) -i $<
|
||||
@$(COMPILE) -wALUA -tT$@ o/$(MODE)/tool/net/redbean.com $(LUAFLAGS) -i $<
|
||||
|
||||
o/$(MODE)/%: o/$(MODE)/%.com o/$(MODE)/tool/build/cp.com o/$(MODE)/tool/build/assimilate.com
|
||||
@$(COMPILE) -ACP -T$@ o/$(MODE)/tool/build/cp.com $< $@
|
||||
@$(COMPILE) -AASSIMILATE -T$@ o/$(MODE)/tool/build/assimilate.com $@
|
||||
@$(COMPILE) -wACP -T$@ o/$(MODE)/tool/build/cp.com $< $@
|
||||
@$(COMPILE) -wAASSIMILATE -T$@ o/$(MODE)/tool/build/assimilate.com $@
|
||||
|
||||
# TODO(jart): find a way to generate dependencies
|
||||
# or alternatively disable sandboxing
|
||||
o/%.h.ok: %.h
|
||||
@$(COMPILE) -ACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.h.ok: %.h
|
||||
@$(COMPILE) -ACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.c) -xc -g0 -o $@ $<
|
||||
o/$(MODE)/%.hh.ok: %.hh
|
||||
@$(COMPILE) -ACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/%.okk: %
|
||||
@$(COMPILE) -ACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
o/$(MODE)/%.okk: %
|
||||
@$(COMPILE) -ACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
@$(COMPILE) -wACHECK.h -T$@ build/bootstrap/touch.com $@
|
||||
# @$(COMPILE) -ACHECK.h $(COMPILE.cxx) -xc++ -g0 -o $@ $<
|
||||
|
|
|
@ -89,11 +89,11 @@ o/$(MODE)/test/libc/mem/prog/life.com.dbg: \
|
|||
o/$(MODE)/test/libc/mem/prog/life.elf: \
|
||||
o/$(MODE)/tool/build/assimilate.com \
|
||||
o/$(MODE)/test/libc/mem/prog/life.com
|
||||
@$(COMPILE) -ACP -T$@ \
|
||||
@$(COMPILE) -wACP -T$@ \
|
||||
build/bootstrap/cp.com \
|
||||
o/$(MODE)/test/libc/mem/prog/life.com \
|
||||
o/$(MODE)/test/libc/mem/prog/life.elf
|
||||
@$(COMPILE) -AASSIMILATE -T$@ \
|
||||
@$(COMPILE) -wAASSIMILATE -T$@ \
|
||||
o/$(MODE)/tool/build/assimilate.com \
|
||||
o/$(MODE)/test/libc/mem/prog/life.elf
|
||||
|
||||
|
@ -114,11 +114,11 @@ o/$(MODE)/test/libc/mem/prog/sock.com.dbg: \
|
|||
o/$(MODE)/test/libc/mem/prog/sock.elf: \
|
||||
o/$(MODE)/tool/build/assimilate.com \
|
||||
o/$(MODE)/test/libc/mem/prog/sock.com
|
||||
@$(COMPILE) -ACP -T$@ \
|
||||
@$(COMPILE) -wACP -T$@ \
|
||||
build/bootstrap/cp.com \
|
||||
o/$(MODE)/test/libc/mem/prog/sock.com \
|
||||
o/$(MODE)/test/libc/mem/prog/sock.elf
|
||||
@$(COMPILE) -AASSIMILATE -T$@ \
|
||||
@$(COMPILE) -wAASSIMILATE -T$@ \
|
||||
o/$(MODE)/tool/build/assimilate.com \
|
||||
o/$(MODE)/test/libc/mem/prog/sock.elf
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ o/$(MODE)/test/libc/nexgen32e/stackrwx_test.com.ok: \
|
|||
o/$(MODE)/tool/build/runit.com \
|
||||
o/$(MODE)/tool/build/runitd.com \
|
||||
o/$(MODE)/test/libc/nexgen32e/stackrwx_test.com
|
||||
@$(COMPILE) -ATEST -tT$@ $^ $(filter-out openbsd,$(HOSTS))
|
||||
@$(COMPILE) -wATEST -tT$@ $^ $(filter-out openbsd,$(HOSTS))
|
||||
|
||||
$(TEST_LIBC_NEXGEN32E_OBJS): private \
|
||||
DEFAULT_CCFLAGS += \
|
||||
|
|
|
@ -88,7 +88,7 @@ o/$(MODE)/test/libc/release/smoke-chibicc.o: \
|
|||
test/libc/release/smoke.c \
|
||||
o/cosmopolitan.h \
|
||||
o/$(MODE)/third_party/chibicc/chibicc.com
|
||||
@$(COMPILE) -ACHIBICC \
|
||||
@$(COMPILE) -wACHIBICC \
|
||||
o/$(MODE)/third_party/chibicc/chibicc.com \
|
||||
$(CHIBICC_FLAGS) \
|
||||
-o $@ \
|
||||
|
|
2
third_party/chibicc/test/test.mk
vendored
2
third_party/chibicc/test/test.mk
vendored
|
@ -72,7 +72,7 @@ o/$(MODE)/third_party/chibicc/test/%.com.dbg: \
|
|||
o/$(MODE)/third_party/chibicc/test/%.o: \
|
||||
third_party/chibicc/test/%.c \
|
||||
$(CHIBICC)
|
||||
@$(COMPILE) -AOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
||||
@$(COMPILE) -wAOBJECTIFY.c $(CHIBICC) $(CHIBICC_FLAGS) $(OUTPUT_OPTION) -c $<
|
||||
|
||||
o/$(MODE)/third_party/chibicc/test/int128_test.o: private QUOTA = -M1024m
|
||||
|
||||
|
|
|
@ -122,39 +122,39 @@ THIRD_PARTY_DOUBLECONVERSION_TEST_RUNS = \
|
|||
|
||||
o/$(MODE)/third_party/double-conversion/test-strtod.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-strtod
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-strtod
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-ieee.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-ieee
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-ieee
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-fixed-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-fixed-dtoa
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-fixed-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-fast-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-fast-dtoa
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-fast-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-dtoa
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-diy-fp.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-diy-fp
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-diy-fp
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-conversions.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-conversions
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-conversions
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-bignum-dtoa.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-bignum-dtoa
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-bignum-dtoa
|
||||
|
||||
o/$(MODE)/third_party/double-conversion/test-bignum.runs: \
|
||||
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< test-bignum
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< test-bignum
|
||||
|
||||
THIRD_PARTY_DOUBLECONVERSION_LIBS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)))
|
||||
THIRD_PARTY_DOUBLECONVERSION_SRCS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)_SRCS))
|
||||
|
|
3
third_party/make/job.c
vendored
3
third_party/make/job.c
vendored
|
@ -1866,10 +1866,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||
errno = err;
|
||||
fd = open (c->file->name, O_RDWR | O_CREAT, 0777);
|
||||
if (fd != -1)
|
||||
{
|
||||
futimens (fd, (struct timespec[2]){0});
|
||||
close (fd);
|
||||
}
|
||||
else if (errno == EEXIST)
|
||||
errno = err;
|
||||
else
|
||||
|
|
2
third_party/mbedtls/test/test.mk
vendored
2
third_party/mbedtls/test/test.mk
vendored
|
@ -137,7 +137,7 @@ o/$(MODE)/third_party/mbedtls/test/%.com: o/$(MODE)/third_party/mbedtls/test/%.c
|
|||
@$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
|
||||
|
||||
o/$(MODE)/third_party/mbedtls/test/%.com.runs: o/$(MODE)/third_party/mbedtls/test/%.com
|
||||
@$(COMPILE) -ACHECK -tT$@ $< $(TESTARGS)
|
||||
@$(COMPILE) -ACHECK -wtT$@ $< $(TESTARGS)
|
||||
|
||||
$(THIRD_PARTY_MBEDTLS_TEST_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
|
|
748
third_party/python/python.mk
vendored
748
third_party/python/python.mk
vendored
File diff suppressed because it is too large
Load diff
4
third_party/quickjs/quickjs.mk
vendored
4
third_party/quickjs/quickjs.mk
vendored
|
@ -132,12 +132,12 @@ THIRD_PARTY_QUICKJS_CHECKS = \
|
|||
o/$(MODE)/third_party/quickjs/qjscalc.c: \
|
||||
third_party/quickjs/qjscalc.js \
|
||||
o/$(MODE)/third_party/quickjs/qjsc.com
|
||||
@$(COMPILE) -AQJSC o/$(MODE)/third_party/quickjs/qjsc.com -fbignum -o $@ -c $<
|
||||
@$(COMPILE) -wAQJSC o/$(MODE)/third_party/quickjs/qjsc.com -fbignum -o $@ -c $<
|
||||
|
||||
o/$(MODE)/third_party/quickjs/repl.c: \
|
||||
third_party/quickjs/repl.js \
|
||||
o/$(MODE)/third_party/quickjs/qjsc.com
|
||||
@$(COMPILE) -AQJSC o/$(MODE)/third_party/quickjs/qjsc.com -o $@ -m -c $<
|
||||
@$(COMPILE) -wAQJSC o/$(MODE)/third_party/quickjs/qjsc.com -o $@ -m -c $<
|
||||
|
||||
o/$(MODE)/third_party/quickjs/qjs.com.dbg: \
|
||||
$(THIRD_PARTY_QUICKJS) \
|
||||
|
|
|
@ -87,7 +87,7 @@ o/$(MODE)/tool/build/build.pkg: \
|
|||
o/$(MODE)/%.ctest.ok: \
|
||||
%.ctest \
|
||||
$(TOOL_BUILD_CALCULATOR)
|
||||
@$(COMPILE) -AMKWIDES -tT$@ $(TOOL_BUILD_CALCULATOR) $<
|
||||
@$(COMPILE) -AMKWIDES -wtT$@ $(TOOL_BUILD_CALCULATOR) $<
|
||||
|
||||
o/$(MODE)/tool/build/%.com.dbg: \
|
||||
$(TOOL_BUILD_DEPS) \
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/alg/alg.h"
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
|
@ -41,6 +42,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/nexgen32e/kcpuids.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
|
@ -49,6 +51,7 @@
|
|||
#include "libc/sysv/consts/auxv.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/sysv/consts/itimer.h"
|
||||
#include "libc/sysv/consts/madv.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/rlimit.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
|
@ -109,6 +112,7 @@ FLAGS\n\
|
|||
-s decrement verbosity [default 4]\n\
|
||||
-v increments verbosity [default 4]\n\
|
||||
-n do nothing (prime ape executable)\n\
|
||||
-w disable landlock tmp workaround\n\
|
||||
-h print help\n\
|
||||
\n\
|
||||
ENVIRONMENT\n\
|
||||
|
@ -144,6 +148,7 @@ bool wantfentry;
|
|||
bool wantrecord;
|
||||
bool fulloutput;
|
||||
bool touchtarget;
|
||||
bool noworkaround;
|
||||
bool wantnoredzone;
|
||||
bool stdoutmustclose;
|
||||
bool no_sanitize_null;
|
||||
|
@ -711,6 +716,8 @@ void ReportResources(void) {
|
|||
|
||||
bool MovePreservingDestinationInode(const char *from, const char *to) {
|
||||
bool res;
|
||||
ssize_t rc;
|
||||
size_t remain;
|
||||
struct stat st;
|
||||
int fdin, fdout;
|
||||
if ((fdin = open(from, O_RDONLY)) == -1) {
|
||||
|
@ -721,7 +728,30 @@ bool MovePreservingDestinationInode(const char *from, const char *to) {
|
|||
close(fdin);
|
||||
return false;
|
||||
}
|
||||
fadvise(fdin, 0, st.st_size, MADV_SEQUENTIAL);
|
||||
ftruncate(fdout, st.st_size);
|
||||
for (res = true, remain = st.st_size; remain;) {
|
||||
rc = copy_file_range(fdin, 0, fdout, 0, remain, 0);
|
||||
if (rc != -1) {
|
||||
remain -= rc;
|
||||
} else if (errno == EXDEV) {
|
||||
if (lseek(fdin, 0, SEEK_SET) == -1) {
|
||||
kprintf("%s: failed to lseek after exdev\n", from);
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
if (lseek(fdout, 0, SEEK_SET) == -1) {
|
||||
kprintf("%s: failed to lseek after exdev\n", to);
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
res = _copyfd(fdin, fdout, -1) != -1;
|
||||
break;
|
||||
} else {
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(fdin);
|
||||
close(fdout);
|
||||
return res;
|
||||
|
@ -747,6 +777,23 @@ bool IsNativeExecutable(const char *path) {
|
|||
return res;
|
||||
}
|
||||
|
||||
char *MakeTmpOut(const char *path) {
|
||||
int c;
|
||||
char *p = tmpout;
|
||||
char *e = tmpout + sizeof(tmpout) - 1;
|
||||
p = stpcpy(p, kTmpPath);
|
||||
while ((c = *path++)) {
|
||||
if (c == '/') c = '_';
|
||||
if (p == e) {
|
||||
kprintf("MakeTmpOut path too long: %s\n", tmpout);
|
||||
exit(1);
|
||||
}
|
||||
*p++ = c;
|
||||
}
|
||||
*p = 0;
|
||||
return tmpout;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int columns;
|
||||
uint64_t us;
|
||||
|
@ -757,7 +804,6 @@ int main(int argc, char *argv[]) {
|
|||
char *s, *p, *q, **envp;
|
||||
|
||||
mode = firstnonnull(getenv("MODE"), MODE);
|
||||
ksnprintf(tmpout, sizeof(tmpout), "%scompile.%d", kTmpPath, getpid());
|
||||
|
||||
/*
|
||||
* parse prefix arguments
|
||||
|
@ -769,7 +815,7 @@ int main(int argc, char *argv[]) {
|
|||
fszquota = 256 * 1000 * 1000; /* bytes */
|
||||
memquota = 512 * 1024 * 1024; /* bytes */
|
||||
if ((s = getenv("V"))) verbose = atoi(s);
|
||||
while ((opt = getopt(argc, argv, "hnstvA:C:F:L:M:O:P:T:V:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hnstvwA:C:F:L:M:O:P:T:V:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'n':
|
||||
exit(0);
|
||||
|
@ -788,6 +834,9 @@ int main(int argc, char *argv[]) {
|
|||
case 't':
|
||||
touchtarget = true;
|
||||
break;
|
||||
case 'w':
|
||||
noworkaround = true;
|
||||
break;
|
||||
case 'L':
|
||||
timeout = atoi(optarg);
|
||||
break;
|
||||
|
@ -856,17 +905,37 @@ int main(int argc, char *argv[]) {
|
|||
* ingest arguments
|
||||
*/
|
||||
for (i = optind; i < argc; ++i) {
|
||||
if (!movepath && !outpath && target && !strcmp(target, argv[i])) {
|
||||
outpath = argv[i];
|
||||
AddArg(tmpout);
|
||||
|
||||
/*
|
||||
* replace output filename argument
|
||||
*
|
||||
* some commands (e.g. ar) don't use the `-o PATH` notation. in that
|
||||
* case we assume the output path was passed to compile.com -TTARGET
|
||||
* which means we can replace the appropriate command line argument.
|
||||
*/
|
||||
if (!noworkaround && //
|
||||
!movepath && //
|
||||
!outpath && //
|
||||
target && //
|
||||
!strcmp(target, argv[i])) {
|
||||
AddArg(MakeTmpOut(argv[i]));
|
||||
outpath = target;
|
||||
movepath = target;
|
||||
MovePreservingDestinationInode(target, tmpout);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* capture arguments
|
||||
*/
|
||||
if (argv[i][0] != '-') {
|
||||
AddArg(argv[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* capture flags
|
||||
*/
|
||||
if (startswith(argv[i], "-o")) {
|
||||
if (!strcmp(argv[i], "-o")) {
|
||||
outpath = argv[++i];
|
||||
|
@ -874,8 +943,12 @@ int main(int argc, char *argv[]) {
|
|||
outpath = argv[i] + 2;
|
||||
}
|
||||
AddArg("-o");
|
||||
AddArg(tmpout);
|
||||
if (noworkaround) {
|
||||
AddArg(outpath);
|
||||
} else {
|
||||
movepath = outpath;
|
||||
AddArg(MakeTmpOut(outpath));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!iscc) {
|
||||
|
|
|
@ -116,8 +116,8 @@ o/$(MODE)/tool/net/redbean.com: \
|
|||
o/$(MODE)/tool/net/redbean.com.dbg \
|
||||
o/$(MODE)/tool/build/symtab.com
|
||||
@$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
|
||||
@$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com -o $(SYMTAB) $<
|
||||
@$(COMPILE) -AZIP -T$@ $@ -A $(SYMTAB)
|
||||
@$(COMPILE) -wASYMTAB o/$(MODE)/tool/build/symtab.com -o $(SYMTAB) $<
|
||||
@$(COMPILE) -wAZIP -T$@ $@ -A $(SYMTAB)
|
||||
|
||||
# REDBEAN-DEMO.COM
|
||||
#
|
||||
|
@ -229,8 +229,8 @@ o/$(MODE)/tool/net/redbean-demo.com: \
|
|||
o/$(MODE)/tool/net/redbean-demo.com.dbg \
|
||||
o/$(MODE)/tool/build/symtab.com
|
||||
@$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
|
||||
@$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com -o $(SYMTAB) $<
|
||||
@$(COMPILE) -AZIP -T$@ $@ -A $(SYMTAB)
|
||||
@$(COMPILE) -wASYMTAB o/$(MODE)/tool/build/symtab.com -o $(SYMTAB) $<
|
||||
@$(COMPILE) -wAZIP -T$@ $@ -A $(SYMTAB)
|
||||
|
||||
# REDBEAN-STATIC.COM
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue