Skip to content

Commit aeffdef

Browse files
authored
Merge pull request NixOS#11826 from DeterminateSystems/revert-11804
Revert "Merge pull request NixOS#11804 from obsidiansystems/remove-old-make"
2 parents 723fdeb + 67d231c commit aeffdef

134 files changed

Lines changed: 4722 additions & 75 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ perl/Makefile.config
102102
/tests/functional/restricted-innocent
103103
/tests/functional/shell
104104
/tests/functional/shell.drv
105+
/tests/functional/config.nix
106+
/tests/functional/ca/config.nix
107+
/tests/functional/dyn-drv/config.nix
105108
/tests/functional/repl-result-out
106109
/tests/functional/debugger-test-out
107110
/tests/functional/test-libstoreconsumer/test-libstoreconsumer

Makefile

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# External build directory support
2+
3+
include mk/build-dir.mk
4+
5+
-include $(buildprefix)Makefile.config
6+
clean-files += $(buildprefix)Makefile.config
7+
8+
# List makefiles
9+
10+
include mk/platform.mk
11+
12+
ifeq ($(ENABLE_BUILD), yes)
13+
makefiles = \
14+
mk/precompiled-headers.mk \
15+
local.mk \
16+
src/libutil/local.mk \
17+
src/libstore/local.mk \
18+
src/libfetchers/local.mk \
19+
src/libmain/local.mk \
20+
src/libexpr/local.mk \
21+
src/libflake/local.mk \
22+
src/libcmd/local.mk \
23+
src/nix/local.mk \
24+
src/libutil-c/local.mk \
25+
src/libstore-c/local.mk \
26+
src/libexpr-c/local.mk
27+
28+
ifdef HOST_UNIX
29+
makefiles += \
30+
scripts/local.mk \
31+
maintainers/local.mk \
32+
misc/bash/local.mk \
33+
misc/fish/local.mk \
34+
misc/zsh/local.mk \
35+
misc/systemd/local.mk \
36+
misc/launchd/local.mk \
37+
misc/upstart/local.mk
38+
endif
39+
endif
40+
41+
ifeq ($(ENABLE_UNIT_TESTS), yes)
42+
makefiles += \
43+
src/libutil-tests/local.mk \
44+
src/libutil-test-support/local.mk \
45+
src/libstore-tests/local.mk \
46+
src/libstore-test-support/local.mk \
47+
src/libfetchers-tests/local.mk \
48+
src/libexpr-tests/local.mk \
49+
src/libexpr-test-support/local.mk \
50+
src/libflake-tests/local.mk
51+
endif
52+
53+
ifeq ($(ENABLE_FUNCTIONAL_TESTS), yes)
54+
ifdef HOST_UNIX
55+
makefiles += \
56+
tests/functional/local.mk \
57+
tests/functional/flakes/local.mk \
58+
tests/functional/ca/local.mk \
59+
tests/functional/git-hashing/local.mk \
60+
tests/functional/dyn-drv/local.mk \
61+
tests/functional/local-overlay-store/local.mk \
62+
tests/functional/test-libstoreconsumer/local.mk \
63+
tests/functional/plugins/local.mk
64+
endif
65+
endif
66+
67+
# Some makefiles require access to built programs and must be included late.
68+
makefiles-late =
69+
70+
ifeq ($(ENABLE_DOC_GEN), yes)
71+
makefiles-late += doc/manual/local.mk
72+
endif
73+
74+
# Miscellaneous global Flags
75+
76+
OPTIMIZE = 1
77+
78+
ifeq ($(OPTIMIZE), 1)
79+
GLOBAL_CXXFLAGS += -O3 $(CXXLTO)
80+
GLOBAL_LDFLAGS += $(CXXLTO)
81+
else
82+
GLOBAL_CXXFLAGS += -O0 -U_FORTIFY_SOURCE
83+
unexport NIX_HARDENING_ENABLE
84+
endif
85+
86+
ifdef HOST_WINDOWS
87+
# Windows DLLs are stricter about symbol visibility than Unix shared
88+
# objects --- see https://gcc.gnu.org/wiki/Visibility for details.
89+
# This is a temporary sledgehammer to export everything like on Unix,
90+
# and not detail with this yet.
91+
#
92+
# TODO do not do this, and instead do fine-grained export annotations.
93+
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
94+
GLOBAL_CXXFLAGS += -D_WIN32_WINNT=0x0602
95+
endif
96+
97+
GLOBAL_CXXFLAGS += -g -Wall -Wdeprecated-copy -Wignored-qualifiers -Wimplicit-fallthrough -Werror=unused-result -Werror=suggest-override -include $(buildprefix)config.h -std=c++2a -I src
98+
99+
# Include the main lib, causing rules to be defined
100+
101+
include mk/lib.mk
102+
103+
# Fallback stub rules for better UX when things are disabled
104+
#
105+
# These must be defined after `mk/lib.mk`. Otherwise the first rule
106+
# incorrectly becomes the default target.
107+
108+
ifneq ($(ENABLE_UNIT_TESTS), yes)
109+
.PHONY: check
110+
check:
111+
@echo "Unit tests are disabled. Configure without '--disable-unit-tests', or avoid calling 'make check'."
112+
@exit 1
113+
endif
114+
115+
ifneq ($(ENABLE_FUNCTIONAL_TESTS), yes)
116+
.PHONY: installcheck
117+
installcheck:
118+
@echo "Functional tests are disabled. Configure without '--disable-functional-tests', or avoid calling 'make installcheck'."
119+
@exit 1
120+
endif
121+
122+
# Documentation fallback stub rules.
123+
124+
ifneq ($(ENABLE_DOC_GEN), yes)
125+
.PHONY: manual-html manpages
126+
manual-html manpages:
127+
@echo "Generated docs are disabled. Configure without '--disable-doc-gen', or avoid calling 'make manpages' and 'make manual-html'."
128+
@exit 1
129+
endif

Makefile.config.in

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
AR = @AR@
2+
BDW_GC_LIBS = @BDW_GC_LIBS@
3+
BOOST_LDFLAGS = @BOOST_LDFLAGS@
4+
BUILD_SHARED_LIBS = @BUILD_SHARED_LIBS@
5+
CC = @CC@
6+
CFLAGS = @CFLAGS@
7+
CXX = @CXX@
8+
CXXFLAGS = @CXXFLAGS@
9+
CXXLTO = @CXXLTO@
10+
EDITLINE_LIBS = @EDITLINE_LIBS@
11+
ENABLE_BUILD = @ENABLE_BUILD@
12+
ENABLE_DOC_GEN = @ENABLE_DOC_GEN@
13+
ENABLE_FUNCTIONAL_TESTS = @ENABLE_FUNCTIONAL_TESTS@
14+
ENABLE_S3 = @ENABLE_S3@
15+
ENABLE_UNIT_TESTS = @ENABLE_UNIT_TESTS@
16+
GTEST_LIBS = @GTEST_LIBS@
17+
HAVE_LIBCPUID = @HAVE_LIBCPUID@
18+
HAVE_SECCOMP = @HAVE_SECCOMP@
19+
HOST_OS = @host_os@
20+
INSTALL_UNIT_TESTS = @INSTALL_UNIT_TESTS@
21+
LDFLAGS = @LDFLAGS@
22+
LIBARCHIVE_LIBS = @LIBARCHIVE_LIBS@
23+
LIBBROTLI_LIBS = @LIBBROTLI_LIBS@
24+
LIBCURL_LIBS = @LIBCURL_LIBS@
25+
LIBGIT2_LIBS = @LIBGIT2_LIBS@
26+
LIBSECCOMP_LIBS = @LIBSECCOMP_LIBS@
27+
LOWDOWN_LIBS = @LOWDOWN_LIBS@
28+
OPENSSL_LIBS = @OPENSSL_LIBS@
29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
PACKAGE_VERSION = @PACKAGE_VERSION@
31+
SHELL = @bash@
32+
SODIUM_LIBS = @SODIUM_LIBS@
33+
SQLITE3_LIBS = @SQLITE3_LIBS@
34+
bash = @bash@
35+
bindir = @bindir@
36+
checkbindir = @checkbindir@
37+
checklibdir = @checklibdir@
38+
datadir = @datadir@
39+
datarootdir = @datarootdir@
40+
docdir = @docdir@
41+
embedded_sandbox_shell = @embedded_sandbox_shell@
42+
exec_prefix = @exec_prefix@
43+
includedir = @includedir@
44+
libdir = @libdir@
45+
libexecdir = @libexecdir@
46+
localstatedir = @localstatedir@
47+
lsof = @lsof@
48+
mandir = @mandir@
49+
pkglibdir = $(libdir)/$(PACKAGE_NAME)
50+
prefix = @prefix@
51+
sandbox_shell = @sandbox_shell@
52+
storedir = @storedir@
53+
sysconfdir = @sysconfdir@
54+
system = @system@

0 commit comments

Comments
 (0)