summary refs log tree commit diff
path: root/src/Makefile.am
blob: e5aa15fd9f84d58af7932d54f706d56396f0a3ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
bin_PROGRAMS = nix nix-hash fix
check_PROGRAMS = test


AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../externals/inst/include $(CXXFLAGS)
LDADD = -L../externals/inst/lib -ldb_cxx -lATerm -L../boost/format -lformat

nix_SOURCES = nix.cc dotgraph.cc
nix_LDADD = libshared.a libnix.a $(LDADD)

nix_hash_SOURCES = nix-hash.cc
nix_hash_LDADD = libshared.a libnix.a $(LDADD)

fix_SOURCES = fix.cc
fix_LDADD = libshared.a libnix.a $(LDADD)

TESTS = test

test_SOURCES = test.cc
test_LDADD = libshared.a libnix.a $(LDADD)


noinst_LIBRARIES = libnix.a libshared.a

libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
 store.cc fstate.cc normalise.cc exec.cc \
 globals.cc db.cc references.cc pathlocks.cc

libshared_a_SOURCES = shared.cc

libshared_a_CXXFLAGS = \
 -DNIX_STORE_DIR=\"$(prefix)/store\" \
 -DNIX_DATA_DIR=\"$(datadir)\" \
 -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
 -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
 $(AM_CXXFLAGS)

nix.o: nix-help.txt.hh

%.hh: %
	echo -n '"' > $@
	sed 's|\(.*\)|\1\\n\\|' < $< >> $@
	echo '"' >> $@

install-data-local:
	$(INSTALL) -d $(localstatedir)/nix
	$(INSTALL) -d $(localstatedir)/nix/db
	$(INSTALL) -d $(localstatedir)/nix/links
	rm -f $(prefix)/current
	ln -sf $(localstatedir)/nix/links/current $(prefix)/current
	$(INSTALL) -d $(localstatedir)/log/nix
	$(INSTALL) -d $(prefix)/store
	$(bindir)/nix --init

EXTRA_DIST = *.hh *.h test-builder-*.sh