2013-09-29 00:21:18 +04:00
|
|
|
# A simple makefile.
|
|
|
|
#
|
|
|
|
|
2014-11-14 02:33:46 +03:00
|
|
|
default: all
|
2015-04-01 23:56:43 +03:00
|
|
|
-include .make.conf
|
2014-11-14 02:33:46 +03:00
|
|
|
|
|
|
|
CORE=.MAKEFILE-VERSION
|
|
|
|
|
2015-02-20 08:27:23 +03:00
|
|
|
# Pick one of:
|
|
|
|
# linux
|
|
|
|
# osx
|
|
|
|
|
2013-09-29 00:21:18 +04:00
|
|
|
UNAME=$(shell uname)
|
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
OS=osx
|
|
|
|
else ifeq ($(UNAME),Linux)
|
|
|
|
OS=linux
|
2013-10-02 18:44:22 +04:00
|
|
|
else ifeq ($(UNAME),FreeBSD)
|
2013-10-07 20:31:41 +04:00
|
|
|
OS=bsd
|
2013-10-30 22:44:35 +04:00
|
|
|
else ifeq ($(UNAME),OpenBSD)
|
2013-10-07 20:31:41 +04:00
|
|
|
OS=bsd
|
2015-06-23 19:59:37 +03:00
|
|
|
else
|
2013-09-29 00:21:18 +04:00
|
|
|
$(error unknown unix)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Pick one of:
|
|
|
|
# little
|
|
|
|
# big
|
|
|
|
#
|
|
|
|
ENDIAN=little
|
|
|
|
|
|
|
|
# Binary directory - not in quotes.
|
|
|
|
#
|
|
|
|
BIN=bin
|
|
|
|
|
2015-03-06 04:58:57 +03:00
|
|
|
LIB=$(shell pwd)/urb
|
2013-09-29 00:21:18 +04:00
|
|
|
|
|
|
|
RM=rm -f
|
2015-06-19 06:52:38 +03:00
|
|
|
ifneq ($(UNAME),FreeBSD)
|
2013-09-29 00:21:18 +04:00
|
|
|
CC=gcc
|
2014-04-10 15:22:55 +04:00
|
|
|
CXX=g++
|
|
|
|
CXXFLAGS=$(CFLAGS)
|
2015-05-13 00:39:45 +03:00
|
|
|
CLD=g++ -O3 -L/usr/local/lib -L/opt/local/lib
|
2015-06-19 06:52:38 +03:00
|
|
|
else
|
|
|
|
CC=cc
|
|
|
|
CXX=c++
|
|
|
|
CXXFLAGS=$(CFLAGS)
|
|
|
|
CLD=c++ -O3 -L/usr/local/lib -L/opt/local/lib
|
|
|
|
endif
|
2013-09-29 00:21:18 +04:00
|
|
|
|
|
|
|
ifeq ($(OS),osx)
|
2014-09-07 02:39:28 +04:00
|
|
|
COSFLAGS=-fno-diagnostics-fixit-info
|
2013-09-29 00:21:18 +04:00
|
|
|
CLDOSFLAGS=-bind_at_load
|
|
|
|
OSLIBS=-framework CoreServices -framework CoreFoundation
|
|
|
|
endif
|
|
|
|
ifeq ($(OS),linux)
|
2014-08-21 02:09:51 +04:00
|
|
|
OSLIBS=-lpthread -lrt -lcurses -lz
|
2014-01-27 22:48:55 +04:00
|
|
|
DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
2013-09-29 00:21:18 +04:00
|
|
|
endif
|
2013-10-07 20:31:41 +04:00
|
|
|
ifeq ($(OS),bsd)
|
2014-04-10 03:35:31 +04:00
|
|
|
OSLIBS=-lpthread -lncurses -lkvm
|
2013-10-02 18:44:22 +04:00
|
|
|
endif
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-05-20 02:07:05 +04:00
|
|
|
ifeq ($(STATIC),yes)
|
|
|
|
LIBS=-lssl -lcrypto -lncurses /usr/local/lib/libsigsegv.a /usr/local/lib/libgmp.a $(OSLIBS)
|
|
|
|
else
|
2014-04-10 22:50:13 +04:00
|
|
|
LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
|
2014-05-20 02:07:05 +04:00
|
|
|
endif
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-06-24 04:28:38 +03:00
|
|
|
INCLUDE=include
|
2014-11-05 03:29:08 +03:00
|
|
|
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-10-19 11:33:25 +03:00
|
|
|
DEBUG=no
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),yes)
|
|
|
|
DEBUGFLAGS=-g
|
|
|
|
else
|
|
|
|
DEBUGFLAGS=-O3
|
|
|
|
endif
|
|
|
|
|
2014-10-28 20:36:22 +03:00
|
|
|
# NOTFORCHECKIN - restore -O3
|
2015-09-03 02:20:11 +03:00
|
|
|
# -DGHETTO \
|
2015-07-17 21:55:32 +03:00
|
|
|
# -DHUSH
|
2015-10-19 11:33:25 +03:00
|
|
|
CFLAGS= $(COSFLAGS) $(DEBUGFLAGS) -ffast-math \
|
2014-06-10 22:02:33 +04:00
|
|
|
-funsigned-char \
|
2013-09-29 00:21:18 +04:00
|
|
|
-I/usr/local/include \
|
|
|
|
-I/opt/local/include \
|
2014-05-06 21:03:36 +04:00
|
|
|
-I$(INCLUDE) \
|
2014-08-23 01:39:35 +04:00
|
|
|
-Ioutside/libuv_0.11/include \
|
2014-06-08 03:05:53 +04:00
|
|
|
-Ioutside/anachronism/include \
|
2014-05-06 21:03:36 +04:00
|
|
|
-Ioutside/bpt \
|
2014-04-10 22:50:13 +04:00
|
|
|
-Ioutside/re2 \
|
2014-04-10 22:31:05 +04:00
|
|
|
-Ioutside/cre2/src/src \
|
2014-04-11 05:05:59 +04:00
|
|
|
-Ioutside/ed25519/src \
|
2014-12-04 01:07:01 +03:00
|
|
|
-Ioutside/commonmark/src \
|
|
|
|
-Ioutside/commonmark/build/src \
|
2015-05-04 02:31:45 +03:00
|
|
|
-Ioutside/scrypt \
|
2015-07-29 06:56:02 +03:00
|
|
|
-Ioutside/softfloat-3/source/include \
|
2014-01-27 22:48:55 +04:00
|
|
|
$(DEFINES) \
|
|
|
|
$(MDEFINES)
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-12-12 03:02:53 +03:00
|
|
|
# TODO remove -Wno-*
|
|
|
|
CWFLAGS=-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Wno-sign-compare \
|
|
|
|
-Wno-unused-parameter \
|
2014-12-19 21:22:56 +03:00
|
|
|
-Wno-missing-field-initializers \
|
2015-02-23 03:11:46 +03:00
|
|
|
-Wno-strict-aliasing \
|
2014-12-19 22:05:57 +03:00
|
|
|
-Werror
|
2015-03-03 00:44:21 +03:00
|
|
|
ifneq ($(OS),bsd)
|
|
|
|
CWFLAGS+=-Wno-error=unused-result
|
|
|
|
endif
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-14 02:33:46 +03:00
|
|
|
ifdef NO_SILENT_RULES
|
|
|
|
%.o: %.c $(CORE)
|
|
|
|
$(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $<
|
|
|
|
@$(CC) -MM -MP $(CWFLAGS) $(CFLAGS) -MT $@ $< -MF .d/$*.d
|
|
|
|
else
|
|
|
|
%.o: %.c $(CORE)
|
|
|
|
@echo " CC $@"
|
|
|
|
@$(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $<
|
|
|
|
@$(CC) -MM -MP $(CWFLAGS) $(CFLAGS) -MT $@ $< -MF .d/$*.d
|
|
|
|
endif
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-06 22:29:53 +03:00
|
|
|
N_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
noun/allocate.o \
|
|
|
|
noun/events.o \
|
|
|
|
noun/hashtable.o \
|
|
|
|
noun/imprison.o \
|
|
|
|
noun/jets.o \
|
|
|
|
noun/manage.o \
|
|
|
|
noun/nock.o \
|
|
|
|
noun/retrieve.o \
|
|
|
|
noun/trace.o \
|
|
|
|
noun/xtract.o \
|
|
|
|
noun/vortex.o \
|
|
|
|
noun/zave.o
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_A_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/a/add.o \
|
|
|
|
jets/a/dec.o \
|
|
|
|
jets/a/div.o \
|
|
|
|
jets/a/gte.o \
|
|
|
|
jets/a/gth.o \
|
|
|
|
jets/a/lte.o \
|
|
|
|
jets/a/lth.o \
|
|
|
|
jets/a/mod.o \
|
|
|
|
jets/a/mul.o \
|
|
|
|
jets/a/sub.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_B_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/b/bind.o \
|
|
|
|
jets/b/clap.o \
|
|
|
|
jets/b/drop.o \
|
|
|
|
jets/b/flop.o \
|
|
|
|
jets/b/lent.o \
|
|
|
|
jets/b/levy.o \
|
|
|
|
jets/b/lien.o \
|
2015-09-14 21:31:02 +03:00
|
|
|
jets/b/murn.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/b/need.o \
|
2015-09-16 23:29:39 +03:00
|
|
|
jets/b/reap.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/b/reel.o \
|
|
|
|
jets/b/roll.o \
|
2015-09-19 19:50:39 +03:00
|
|
|
jets/b/skid.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/b/skim.o \
|
|
|
|
jets/b/skip.o \
|
|
|
|
jets/b/scag.o \
|
|
|
|
jets/b/slag.o \
|
|
|
|
jets/b/snag.o \
|
|
|
|
jets/b/sort.o \
|
|
|
|
jets/b/turn.o \
|
|
|
|
jets/b/weld.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_C_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/c/bex.o \
|
2015-08-27 13:38:24 +03:00
|
|
|
jets/c/xeb.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/c/can.o \
|
|
|
|
jets/c/cap.o \
|
|
|
|
jets/c/cat.o \
|
|
|
|
jets/c/con.o \
|
|
|
|
jets/c/cut.o \
|
|
|
|
jets/c/dor.o \
|
2015-07-29 23:43:55 +03:00
|
|
|
jets/c/dvr.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/c/dis.o \
|
|
|
|
jets/c/end.o \
|
|
|
|
jets/c/gor.o \
|
|
|
|
jets/c/hor.o \
|
|
|
|
jets/c/lsh.o \
|
|
|
|
jets/c/mas.o \
|
|
|
|
jets/c/met.o \
|
|
|
|
jets/c/mix.o \
|
|
|
|
jets/c/mug.o \
|
|
|
|
jets/c/peg.o \
|
|
|
|
jets/c/po.o \
|
2015-07-29 23:43:55 +03:00
|
|
|
jets/c/pow.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/c/rap.o \
|
|
|
|
jets/c/rip.o \
|
|
|
|
jets/c/rsh.o \
|
2015-07-29 23:43:55 +03:00
|
|
|
jets/c/sqt.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/c/vor.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_D_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/d/in_has.o \
|
|
|
|
jets/d/in_int.o \
|
|
|
|
jets/d/in_gas.o \
|
|
|
|
jets/d/in_mer.o \
|
|
|
|
jets/d/in_put.o \
|
|
|
|
jets/d/in_tap.o \
|
|
|
|
jets/d/in_uni.o \
|
2015-07-02 08:21:38 +03:00
|
|
|
jets/d/in_bif.o \
|
|
|
|
jets/d/in_dif.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/d/by_gas.o \
|
|
|
|
jets/d/by_get.o \
|
|
|
|
jets/d/by_has.o \
|
|
|
|
jets/d/by_int.o \
|
|
|
|
jets/d/by_put.o \
|
2015-07-02 08:21:38 +03:00
|
|
|
jets/d/by_uni.o \
|
|
|
|
jets/d/by_bif.o \
|
|
|
|
jets/d/by_dif.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_E_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/e/aesc.o \
|
|
|
|
jets/e/cue.o \
|
2015-07-31 05:01:20 +03:00
|
|
|
jets/e/fl.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/e/jam.o \
|
|
|
|
jets/e/mat.o \
|
|
|
|
jets/e/mink.o \
|
|
|
|
jets/e/mule.o \
|
|
|
|
jets/e/parse.o \
|
|
|
|
jets/e/rd.o \
|
2015-07-29 19:53:45 +03:00
|
|
|
jets/e/rq.o \
|
2015-07-29 23:43:55 +03:00
|
|
|
jets/e/rs.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/e/repg.o \
|
|
|
|
jets/e/rexp.o \
|
|
|
|
jets/e/rub.o \
|
|
|
|
jets/e/scr.o \
|
|
|
|
jets/e/shax.o \
|
|
|
|
jets/e/lore.o \
|
|
|
|
jets/e/loss.o \
|
|
|
|
jets/e/trip.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_E_OFILES_ED=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/e/ed_puck.o \
|
|
|
|
jets/e/ed_sign.o \
|
|
|
|
jets/e/ed_veri.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_F_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/f/al.o \
|
|
|
|
jets/f/ap.o \
|
|
|
|
jets/f/bull.o \
|
|
|
|
jets/f/cell.o \
|
|
|
|
jets/f/comb.o \
|
|
|
|
jets/f/cons.o \
|
|
|
|
jets/f/core.o \
|
|
|
|
jets/f/cube.o \
|
|
|
|
jets/f/face.o \
|
|
|
|
jets/f/fitz.o \
|
|
|
|
jets/f/flan.o \
|
|
|
|
jets/f/flay.o \
|
|
|
|
jets/f/flip.o \
|
|
|
|
jets/f/flor.o \
|
|
|
|
jets/f/fork.o \
|
|
|
|
jets/f/hike.o \
|
|
|
|
jets/f/look.o \
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:49:41 +03:00
|
|
|
J_F_OFILES_UT=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/f/ut.o \
|
|
|
|
jets/f/ut_burn.o \
|
|
|
|
jets/f/ut_busk.o \
|
|
|
|
jets/f/ut_bust.o \
|
|
|
|
jets/f/ut_conk.o \
|
|
|
|
jets/f/ut_crop.o \
|
|
|
|
jets/f/ut_cull.o \
|
|
|
|
jets/f/ut_find.o \
|
|
|
|
jets/f/ut_fink.o \
|
|
|
|
jets/f/ut_fire.o \
|
|
|
|
jets/f/ut_firm.o \
|
|
|
|
jets/f/ut_fish.o \
|
|
|
|
jets/f/ut_fuse.o \
|
|
|
|
jets/f/ut_gain.o \
|
|
|
|
jets/f/ut_heal.o \
|
|
|
|
jets/f/ut_lose.o \
|
|
|
|
jets/f/ut_mint.o \
|
|
|
|
jets/f/ut_mull.o \
|
|
|
|
jets/f/ut_nest.o \
|
|
|
|
jets/f/ut_park.o \
|
|
|
|
jets/f/ut_peek.o \
|
|
|
|
jets/f/ut_play.o \
|
|
|
|
jets/f/ut_repo.o \
|
|
|
|
jets/f/ut_rest.o \
|
|
|
|
jets/f/ut_seek.o \
|
|
|
|
jets/f/ut_swab.o \
|
|
|
|
jets/f/ut_tack.o \
|
|
|
|
jets/f/ut_tock.o \
|
|
|
|
jets/f/ut_wrap.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-12-04 02:21:55 +03:00
|
|
|
J_G_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/g/down.o
|
2014-12-04 02:21:55 +03:00
|
|
|
|
2014-09-05 23:55:16 +04:00
|
|
|
J_OFILES=\
|
2014-11-06 22:49:41 +03:00
|
|
|
$(J_A_OFILES) \
|
|
|
|
$(J_B_OFILES) \
|
|
|
|
$(J_C_OFILES) \
|
|
|
|
$(J_D_OFILES) \
|
|
|
|
$(J_E_OFILES) \
|
|
|
|
$(J_E_OFILES_ED) \
|
|
|
|
$(J_F_OFILES) \
|
|
|
|
$(J_F_OFILES_UT) \
|
2014-12-04 02:21:55 +03:00
|
|
|
$(J_G_OFILES) \
|
2015-06-24 04:28:38 +03:00
|
|
|
jets/tree.o
|
2014-09-05 23:55:16 +04:00
|
|
|
|
2014-11-06 22:29:53 +03:00
|
|
|
BASE_OFILES=$(N_OFILES) $(J_OFILES)
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-04-10 15:22:55 +04:00
|
|
|
CRE2_OFILES=\
|
|
|
|
outside/cre2/src/src/cre2.o
|
|
|
|
|
2013-09-29 00:21:18 +04:00
|
|
|
OUT_OFILES=\
|
|
|
|
outside/jhttp/http_parser.o
|
|
|
|
|
2014-01-17 21:38:15 +04:00
|
|
|
V_OFILES=\
|
2015-06-24 04:28:38 +03:00
|
|
|
vere/ames.o \
|
2015-06-24 22:50:30 +03:00
|
|
|
vere/behn.o \
|
2015-06-24 04:28:38 +03:00
|
|
|
vere/cttp.o \
|
|
|
|
vere/http.o \
|
|
|
|
vere/loop.o \
|
|
|
|
vere/raft.o \
|
|
|
|
vere/reck.o \
|
|
|
|
vere/sist.o \
|
|
|
|
vere/term.o \
|
|
|
|
vere/time.o \
|
|
|
|
vere/unix.o \
|
|
|
|
vere/save.o \
|
|
|
|
vere/walk.o
|
2014-01-17 21:38:15 +04:00
|
|
|
|
2014-08-21 02:09:51 +04:00
|
|
|
MAIN_FILE =\
|
2015-06-24 04:28:38 +03:00
|
|
|
vere/main.o
|
2014-08-21 02:09:51 +04:00
|
|
|
|
2014-01-17 21:38:15 +04:00
|
|
|
VERE_OFILES=\
|
2014-04-10 15:22:55 +04:00
|
|
|
$(CRE2_OFILES) \
|
|
|
|
$(OUT_OFILES) \
|
2014-09-10 20:06:30 +04:00
|
|
|
$(BASE_OFILES) \
|
|
|
|
$(MAIN_FILE) \
|
2014-04-10 15:22:55 +04:00
|
|
|
$(V_OFILES)
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-11-14 02:33:46 +03:00
|
|
|
VERE_DFILES=$(VERE_OFILES:%.o=.d/%.d)
|
|
|
|
|
|
|
|
-include $(VERE_DFILES)
|
|
|
|
|
2014-08-27 22:14:08 +04:00
|
|
|
# This is a silly hack necessitated by the fact that libuv uses configure
|
2015-06-23 19:59:37 +03:00
|
|
|
#
|
|
|
|
# * Making 'all' obviously requires outside/libuv,
|
2014-09-10 20:06:30 +04:00
|
|
|
# which requires the libuv Makefile to be created.
|
2014-08-27 22:14:08 +04:00
|
|
|
# * Making distclean on outside/libuv destroys the makefile.
|
2015-06-23 19:59:37 +03:00
|
|
|
# * ...so configuring outside/libuv is parodoxically required
|
2014-09-10 20:06:30 +04:00
|
|
|
# in order to distclean it!
|
2014-08-27 22:14:08 +04:00
|
|
|
# * But what if developer types 'make distclean all' ?
|
2015-06-23 19:59:37 +03:00
|
|
|
# * first target makes libuv Makefile, then destroys it...and
|
2014-09-10 20:06:30 +04:00
|
|
|
# second target knows that it was made.
|
2014-08-27 22:14:08 +04:00
|
|
|
# * ...so second target borks.
|
2015-06-23 19:59:37 +03:00
|
|
|
# * Solution: make libuv not only depend on its own Makefile,
|
2014-09-10 20:06:30 +04:00
|
|
|
# but on a side effect of creating its own makefile.
|
2015-06-23 19:59:37 +03:00
|
|
|
#
|
2014-08-26 20:58:46 +04:00
|
|
|
LIBUV_MAKEFILE=outside/libuv_0.11/Makefile
|
2014-08-27 22:14:08 +04:00
|
|
|
LIBUV_MAKEFILE2=outside/libuv_0.11/config.log
|
2014-08-26 00:57:13 +04:00
|
|
|
|
2014-08-23 01:39:35 +04:00
|
|
|
LIBUV=outside/libuv_0.11/.libs/libuv.a
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2014-04-10 22:50:13 +04:00
|
|
|
LIBRE2=outside/re2/obj/libre2.a
|
|
|
|
|
2014-04-11 04:09:01 +04:00
|
|
|
LIBED25519=outside/ed25519/ed25519.a
|
2014-05-20 02:07:05 +04:00
|
|
|
|
2014-06-08 03:05:53 +04:00
|
|
|
LIBANACHRONISM=outside/anachronism/build/libanachronism.a
|
|
|
|
|
2014-12-04 01:07:01 +03:00
|
|
|
LIBCOMMONMARK=outside/commonmark/build/src/libcmark.a
|
|
|
|
|
2015-05-04 02:31:45 +03:00
|
|
|
LIBSCRYPT=outside/scrypt/scrypt.a
|
|
|
|
|
2015-07-29 06:56:02 +03:00
|
|
|
LIBSOFTFLOAT=outside/softfloat-3/build/Linux-386-GCC/softfloat.a
|
|
|
|
|
2015-05-19 21:38:23 +03:00
|
|
|
all: urbit
|
2014-09-29 01:56:17 +04:00
|
|
|
|
2015-04-01 23:56:43 +03:00
|
|
|
.MAKEFILE-VERSION: Makefile .make.conf
|
2014-11-14 02:33:46 +03:00
|
|
|
@echo "Makefile update."
|
|
|
|
@touch .MAKEFILE-VERSION
|
|
|
|
|
2015-04-01 23:56:43 +03:00
|
|
|
.make.conf:
|
|
|
|
@echo "# Set custom configuration here, please!" > ".make.conf"
|
2014-11-14 02:33:46 +03:00
|
|
|
|
2015-05-19 21:38:23 +03:00
|
|
|
urbit: $(BIN)/urbit
|
2014-08-21 02:09:51 +04:00
|
|
|
|
2014-08-27 22:14:08 +04:00
|
|
|
$(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2):
|
2014-08-28 01:42:33 +04:00
|
|
|
cd outside/libuv_0.11 ; sh autogen.sh ; ./configure --disable-dtrace
|
2013-09-29 00:21:18 +04:00
|
|
|
|
2015-06-23 19:59:37 +03:00
|
|
|
# [h]act II: the plot thickens
|
|
|
|
#
|
|
|
|
# * Specifying two targets that each configure libuv works
|
|
|
|
# when the rules are executed sequentially,
|
|
|
|
# * but when attempting a parallel build, it is likely Make
|
|
|
|
# will try to configure libuv simultaneously.
|
|
|
|
# * We can specify a dependency between the two targets so
|
|
|
|
# that execution of their rule(s) is serialized.
|
|
|
|
# * Further, libuv does not seem to be friendly towards
|
|
|
|
# parallel builds either. A true fix is out of scope here
|
|
|
|
# * ...so we must instruct Make to only use one job when it
|
|
|
|
# attempts to build libuv.
|
|
|
|
#
|
|
|
|
$(LIBUV_MAKEFILE2): $(LIBUV_MAKEFILE)
|
|
|
|
|
2014-08-27 22:14:08 +04:00
|
|
|
$(LIBUV): $(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2)
|
2015-06-23 19:59:37 +03:00
|
|
|
$(MAKE) -C outside/libuv_0.11 all-am -j1
|
2014-02-06 01:55:30 +04:00
|
|
|
|
2014-04-10 22:50:13 +04:00
|
|
|
$(LIBRE2):
|
|
|
|
$(MAKE) -C outside/re2 obj/libre2.a
|
|
|
|
|
2014-04-11 04:09:01 +04:00
|
|
|
$(LIBED25519):
|
|
|
|
$(MAKE) -C outside/ed25519
|
|
|
|
|
2014-06-08 03:05:53 +04:00
|
|
|
$(LIBANACHRONISM):
|
|
|
|
$(MAKE) -C outside/anachronism static
|
|
|
|
|
2014-12-04 01:07:01 +03:00
|
|
|
$(LIBCOMMONMARK):
|
|
|
|
$(MAKE) -C outside/commonmark
|
|
|
|
|
2015-05-04 02:31:45 +03:00
|
|
|
$(LIBSCRYPT):
|
|
|
|
$(MAKE) -C outside/scrypt MDEFINES="$(MDEFINES)"
|
|
|
|
|
2015-07-29 06:56:02 +03:00
|
|
|
$(LIBSOFTFLOAT):
|
|
|
|
$(MAKE) -C outside/softfloat-3/build/Linux-386-GCC
|
|
|
|
|
2014-04-10 22:50:13 +04:00
|
|
|
$(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBRE2)
|
2015-02-23 03:11:46 +03:00
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
2014-04-09 22:57:48 +04:00
|
|
|
|
2015-06-24 22:50:30 +03:00
|
|
|
$(V_OFILES): include/vere/vere.h
|
2014-01-17 21:38:15 +04:00
|
|
|
|
2014-11-14 02:33:46 +03:00
|
|
|
ifdef NO_SILENT_RULES
|
2015-07-29 06:56:02 +03:00
|
|
|
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
|
2013-09-29 00:21:18 +04:00
|
|
|
mkdir -p $(BIN)
|
2015-07-29 06:56:02 +03:00
|
|
|
$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
|
2014-11-14 02:33:46 +03:00
|
|
|
else
|
2015-07-29 06:56:02 +03:00
|
|
|
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
|
2015-05-19 21:38:23 +03:00
|
|
|
@echo " CCLD $(BIN)/urbit"
|
2014-11-14 02:33:46 +03:00
|
|
|
@mkdir -p $(BIN)
|
2015-07-29 06:56:02 +03:00
|
|
|
@$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
|
2014-11-14 02:33:46 +03:00
|
|
|
endif
|
2014-09-22 20:10:57 +04:00
|
|
|
|
2013-09-29 00:21:18 +04:00
|
|
|
tags:
|
|
|
|
ctags -R -f .tags --exclude=root
|
|
|
|
|
|
|
|
etags:
|
|
|
|
etags -f .etags $$(find -name '*.c' -or -name '*.h')
|
|
|
|
|
2014-05-20 02:07:05 +04:00
|
|
|
osxpackage:
|
|
|
|
$(RM) -r inst
|
|
|
|
$(MAKE) distclean
|
2015-05-19 21:38:23 +03:00
|
|
|
$(MAKE) $(BIN)/urbit LIB=/usr/local/lib/urb STATIC=yes
|
2014-05-20 02:07:05 +04:00
|
|
|
mkdir -p inst/usr/local/lib/urb inst/usr/local/bin
|
2015-05-19 21:38:23 +03:00
|
|
|
cp $(BIN)/urbit inst/usr/local/bin
|
2014-05-20 02:07:05 +04:00
|
|
|
cp urb/urbit.pill inst/usr/local/lib/urb
|
|
|
|
cp -R urb/zod inst/usr/local/lib/urb
|
2015-05-19 21:38:23 +03:00
|
|
|
pkgbuild --root inst --identifier org.urbit.urbit --version 0.2 urbit.pkg
|
2014-05-20 02:07:05 +04:00
|
|
|
|
2014-05-22 03:21:16 +04:00
|
|
|
debbuild:
|
2015-05-19 21:38:23 +03:00
|
|
|
$(MAKE) $(BIN)/urbit LIB=/usr/share/urb
|
2014-05-22 03:21:16 +04:00
|
|
|
|
|
|
|
debinstall:
|
2014-05-26 05:48:07 +04:00
|
|
|
mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/urb
|
2015-05-19 21:38:23 +03:00
|
|
|
install -m755 $(BIN)/urbit $(DESTDIR)/usr/bin
|
2014-05-26 05:48:07 +04:00
|
|
|
cp urb/urbit.pill $(DESTDIR)/usr/share/urb
|
|
|
|
cp -R urb/zod $(DESTDIR)/usr/share/urb
|
2014-05-22 03:21:16 +04:00
|
|
|
|
2015-06-23 19:59:37 +03:00
|
|
|
clean:
|
2015-05-19 21:38:23 +03:00
|
|
|
$(RM) $(VERE_OFILES) $(BIN)/urbit urbit.pkg $(VERE_DFILES)
|
2015-09-10 07:56:36 +03:00
|
|
|
$(RM) -r debian/files debian/urbit*
|
2014-04-10 23:06:40 +04:00
|
|
|
|
2015-06-23 19:59:37 +03:00
|
|
|
# 'make distclean all -jn' ∀ n>1 still does not work because it is possible
|
|
|
|
# Make will attempt to build urbit while it is also cleaning urbit..
|
2014-08-26 20:58:46 +04:00
|
|
|
distclean: clean $(LIBUV_MAKEFILE)
|
2014-08-26 00:57:13 +04:00
|
|
|
$(MAKE) -C outside/libuv_0.11 distclean
|
2014-04-10 22:50:13 +04:00
|
|
|
$(MAKE) -C outside/re2 clean
|
2014-04-11 04:09:01 +04:00
|
|
|
$(MAKE) -C outside/ed25519 clean
|
2014-06-08 03:05:53 +04:00
|
|
|
$(MAKE) -C outside/anachronism clean
|
2015-05-04 02:31:45 +03:00
|
|
|
$(MAKE) -C outside/scrypt clean
|
2015-07-29 06:56:02 +03:00
|
|
|
$(MAKE) -C outside/softfloat-3/build/Linux-386-GCC clean
|
2014-05-22 03:21:16 +04:00
|
|
|
|
2014-06-10 22:19:55 +04:00
|
|
|
.PHONY: clean debbuild debinstalldistclean etags osxpackage tags
|