urbit/Makefile

582 lines
12 KiB
Makefile
Raw Normal View History

2013-09-29 00:21:18 +04:00
# A simple makefile.
#
# Pick one of:
# linux
# osx
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
OS=osx
else ifeq ($(UNAME),Linux)
OS=linux
else ifeq ($(UNAME),FreeBSD)
OS=bsd
2013-10-30 22:44:35 +04:00
else ifeq ($(UNAME),OpenBSD)
OS=bsd
2013-09-29 00:21:18 +04:00
else
$(error unknown unix)
endif
# Pick one of:
# little
# big
#
ENDIAN=little
# Binary directory - not in quotes.
#
BIN=bin
# Library directory - from whence resources are now loaded.
#
LIB=$(PWD)/lib
RM=rm -f
CC=gcc
2014-04-09 22:57:48 +04:00
CLD=g++ -O2 -g -L/usr/local/lib -L/opt/local/lib
2013-09-29 00:21:18 +04:00
YACC=bison -v -b$(GENERATED)/y
LEX=lex
ifeq ($(OS),osx)
CLDOSFLAGS=-bind_at_load
OSLIBS=-framework CoreServices -framework CoreFoundation
endif
ifeq ($(OS),linux)
2014-04-09 22:57:48 +04:00
OSLIBS=-lcrypto -lpthread -lrt -lcurses
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
ifeq ($(OS),bsd)
2014-04-09 22:57:48 +04:00
OSLIBS=-lcrypto -lpthread -lncurses -lkvm
endif
2013-09-29 00:21:18 +04:00
2014-04-09 22:57:48 +04:00
LIBS=-lgmp -lncurses -lsigsegv $(OSLIBS) -lre2
2013-09-29 00:21:18 +04:00
INCLUDE=include
GENERATED=generated
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\"
2013-09-29 00:21:18 +04:00
2014-04-09 22:57:48 +04:00
CFLAGS= -O2 -g \
2013-09-29 00:21:18 +04:00
-I/usr/local/include \
-I/opt/local/include \
-I$(INCLUDE) \
-Ioutside/libuv/include \
2014-04-09 22:57:48 +04:00
-Ioutside/cre2/include \
2013-09-29 00:21:18 +04:00
-I $(GENERATED) \
2014-01-27 22:48:55 +04:00
$(DEFINES) \
$(MDEFINES)
2013-09-29 00:21:18 +04:00
CWFLAGS=-Wall
.y.o:
mkdir -p $(GENERATED)
$(YACC) $<
$(CC) -c $(CFLAGS) -o $@ $(GENERATED)/y.tab.c
$(RM) $(GENERATED)/y.tab.c
.c.o:
$(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $<
F_OFILES=\
f/rail.o \
f/loom.o \
f/wire.o \
f/chad.o \
f/cash.o \
f/coal.o \
f/hevn.o \
f/host.o \
f/benx.o \
f/trac.o \
f/bail.o \
f/dash.o \
f/unix.o \
f/nock.o
J191_1_OFILES=\
gen191/1/add.o \
gen191/1/dec.o \
gen191/1/div.o \
gen191/1/gte.o \
gen191/1/gth.o \
gen191/1/lte.o \
gen191/1/lth.o \
gen191/1/mod.o \
gen191/1/mul.o \
gen191/1/sub.o
J191_2_OFILES=\
gen191/2/bind.o \
gen191/2/clap.o \
gen191/2/drop.o \
gen191/2/flop.o \
gen191/2/lent.o \
gen191/2/levy.o \
gen191/2/lien.o \
gen191/2/need.o \
gen191/2/reel.o \
gen191/2/roll.o \
gen191/2/skim.o \
gen191/2/skip.o \
gen191/2/slag.o \
gen191/2/snag.o \
gen191/2/sort.o \
gen191/2/turn.o \
gen191/2/weld.o
J191_3_OFILES=\
gen191/3/bex.o \
gen191/3/can.o \
gen191/3/cap.o \
gen191/3/cat.o \
gen191/3/con.o \
gen191/3/cut.o \
gen191/3/dor.o \
gen191/3/dis.o \
gen191/3/end.o \
gen191/3/gor.o \
gen191/3/hor.o \
gen191/3/lsh.o \
gen191/3/mas.o \
gen191/3/met.o \
gen191/3/mix.o \
gen191/3/mug.o \
gen191/3/peg.o \
gen191/3/po.o \
gen191/3/rap.o \
gen191/3/rip.o \
gen191/3/rsh.o \
gen191/3/vor.o
J191_4_OFILES=\
gen191/4/in.o \
gen191/4/by.o \
gen191/4/in_has.o \
gen191/4/in_gas.o \
gen191/4/in_put.o \
gen191/4/in_tap.o \
gen191/4/by_gas.o \
gen191/4/by_get.o \
gen191/4/by_has.o \
gen191/4/by_put.o
J191_5_OFILES=\
gen191/5/cue.o \
gen191/5/jam.o \
gen191/5/mat.o \
gen191/5/mink.o \
gen191/5/parse.o \
gen191/5/rub.o \
gen191/5/shax.o \
gen191/5/lore.o \
gen191/5/loss.o \
gen191/5/tape.o \
gen191/5/trip.o
J191_6_OFILES=\
2013-12-27 06:43:25 +04:00
gen191/6/al.o \
2013-09-29 00:21:18 +04:00
gen191/6/ap.o \
2013-12-26 21:12:07 +04:00
gen191/6/bull.o \
2013-09-29 00:21:18 +04:00
gen191/6/cell.o \
gen191/6/comb.o \
gen191/6/cons.o \
gen191/6/core.o \
gen191/6/cube.o \
gen191/6/face.o \
gen191/6/fitz.o \
gen191/6/flan.o \
gen191/6/flay.o \
gen191/6/flip.o \
gen191/6/flor.o \
gen191/6/fork.o \
gen191/6/hike.o \
gen191/6/look.o \
gen191/6/ut.o
J191_6_OFILES_UT=\
gen191/6/ut_burn.o \
2014-01-04 06:59:56 +04:00
gen191/6/ut_busk.o \
2013-09-29 00:21:18 +04:00
gen191/6/ut_bust.o \
2013-12-18 05:47:20 +04:00
gen191/6/ut_conk.o \
2013-09-29 00:21:18 +04:00
gen191/6/ut_crop.o \
gen191/6/ut_cull.o \
gen191/6/ut_find.o \
gen191/6/ut_fink.o \
gen191/6/ut_fire.o \
gen191/6/ut_firm.o \
gen191/6/ut_fish.o \
gen191/6/ut_fuse.o \
gen191/6/ut_gain.o \
gen191/6/ut_heal.o \
gen191/6/ut_lose.o \
gen191/6/ut_mint.o \
gen191/6/ut_moot.o \
gen191/6/ut_mull.o \
gen191/6/ut_nest.o \
gen191/6/ut_park.o \
gen191/6/ut_peek.o \
gen191/6/ut_play.o \
gen191/6/ut_repo.o \
gen191/6/ut_rest.o \
gen191/6/ut_seek.o \
2014-01-05 06:05:33 +04:00
gen191/6/ut_sift.o \
2013-09-29 00:21:18 +04:00
gen191/6/ut_swab.o \
gen191/6/ut_tack.o \
gen191/6/ut_tock.o \
gen191/6/ut_wrap.o
J191_OFILES=\
$(J191_1_OFILES) \
$(J191_2_OFILES) \
$(J191_3_OFILES) \
$(J191_4_OFILES) \
$(J191_5_OFILES) \
$(J191_6_OFILES) \
$(J191_6_OFILES_UT) \
gen191/watt.o
2014-01-07 00:37:42 +04:00
J190_1_OFILES=\
gen190/1/add.o \
gen190/1/dec.o \
gen190/1/div.o \
gen190/1/gte.o \
gen190/1/gth.o \
gen190/1/lte.o \
gen190/1/lth.o \
gen190/1/mod.o \
gen190/1/mul.o \
gen190/1/sub.o
J190_2_OFILES=\
gen190/2/bind.o \
gen190/2/clap.o \
gen190/2/drop.o \
gen190/2/flop.o \
gen190/2/lent.o \
gen190/2/levy.o \
gen190/2/lien.o \
gen190/2/need.o \
gen190/2/reel.o \
gen190/2/roll.o \
gen190/2/skim.o \
gen190/2/skip.o \
gen190/2/slag.o \
gen190/2/snag.o \
gen190/2/sort.o \
gen190/2/turn.o \
gen190/2/weld.o
J190_3_OFILES=\
gen190/3/bex.o \
gen190/3/can.o \
gen190/3/cap.o \
gen190/3/cat.o \
gen190/3/con.o \
gen190/3/cut.o \
gen190/3/dor.o \
gen190/3/dis.o \
gen190/3/end.o \
gen190/3/gor.o \
gen190/3/hor.o \
gen190/3/lsh.o \
gen190/3/mas.o \
gen190/3/met.o \
gen190/3/mix.o \
gen190/3/mug.o \
gen190/3/peg.o \
gen190/3/po.o \
gen190/3/rap.o \
gen190/3/rip.o \
gen190/3/rsh.o \
gen190/3/vor.o
J190_4_OFILES=\
gen190/4/in.o \
gen190/4/by.o \
gen190/4/in_has.o \
gen190/4/in_gas.o \
gen190/4/in_put.o \
gen190/4/in_tap.o \
gen190/4/by_gas.o \
gen190/4/by_get.o \
gen190/4/by_has.o \
gen190/4/by_put.o
J190_5_OFILES=\
gen190/5/cue.o \
gen190/5/jam.o \
gen190/5/mat.o \
gen190/5/mink.o \
gen190/5/parse.o \
gen190/5/rub.o \
gen190/5/shax.o \
gen190/5/lore.o \
gen190/5/loss.o \
gen190/5/tape.o \
gen190/5/trip.o
J190_6_OFILES=\
gen190/6/al.o \
gen190/6/ap.o \
gen190/6/bull.o \
gen190/6/cell.o \
gen190/6/comb.o \
gen190/6/cons.o \
gen190/6/core.o \
gen190/6/cube.o \
gen190/6/face.o \
gen190/6/fitz.o \
gen190/6/flan.o \
gen190/6/flay.o \
gen190/6/flip.o \
gen190/6/flor.o \
gen190/6/fork.o \
gen190/6/hike.o \
gen190/6/look.o \
gen190/6/ut.o
J190_6_OFILES_UT=\
gen190/6/ut_burn.o \
gen190/6/ut_busk.o \
gen190/6/ut_bust.o \
gen190/6/ut_conk.o \
gen190/6/ut_crop.o \
gen190/6/ut_cull.o \
gen190/6/ut_find.o \
gen190/6/ut_fink.o \
gen190/6/ut_fire.o \
gen190/6/ut_firm.o \
gen190/6/ut_fish.o \
gen190/6/ut_fuse.o \
gen190/6/ut_gain.o \
gen190/6/ut_heal.o \
gen190/6/ut_lose.o \
gen190/6/ut_mint.o \
gen190/6/ut_moot.o \
gen190/6/ut_mull.o \
gen190/6/ut_nest.o \
gen190/6/ut_park.o \
gen190/6/ut_peek.o \
gen190/6/ut_play.o \
gen190/6/ut_repo.o \
gen190/6/ut_rest.o \
gen190/6/ut_seek.o \
gen190/6/ut_sift.o \
gen190/6/ut_swab.o \
gen190/6/ut_tack.o \
gen190/6/ut_tock.o \
gen190/6/ut_wrap.o
J190_OFILES=\
$(J190_1_OFILES) \
$(J190_2_OFILES) \
$(J190_3_OFILES) \
$(J190_4_OFILES) \
$(J190_5_OFILES) \
$(J190_6_OFILES) \
$(J190_6_OFILES_UT) \
gen190/watt.o
J164_1_OFILES=\
gen164/1/add.o \
gen164/1/dec.o \
gen164/1/div.o \
gen164/1/gte.o \
gen164/1/gth.o \
gen164/1/lte.o \
gen164/1/lth.o \
gen164/1/mod.o \
gen164/1/mul.o \
gen164/1/sub.o
J164_2_OFILES=\
gen164/2/bind.o \
gen164/2/clap.o \
gen164/2/drop.o \
gen164/2/flop.o \
gen164/2/lent.o \
gen164/2/levy.o \
gen164/2/lien.o \
gen164/2/need.o \
gen164/2/reel.o \
gen164/2/roll.o \
gen164/2/skim.o \
gen164/2/skip.o \
gen164/2/slag.o \
gen164/2/snag.o \
gen164/2/sort.o \
gen164/2/turn.o \
gen164/2/weld.o
J164_3_OFILES=\
gen164/3/bex.o \
gen164/3/can.o \
gen164/3/cap.o \
gen164/3/cat.o \
gen164/3/con.o \
gen164/3/cut.o \
gen164/3/dor.o \
gen164/3/dis.o \
gen164/3/end.o \
gen164/3/gor.o \
gen164/3/hor.o \
gen164/3/lsh.o \
gen164/3/mas.o \
gen164/3/met.o \
gen164/3/mix.o \
gen164/3/mug.o \
gen164/3/peg.o \
gen164/3/po.o \
gen164/3/rap.o \
gen164/3/rip.o \
gen164/3/rsh.o \
gen164/3/vor.o
J164_4_OFILES=\
gen164/4/in.o \
gen164/4/by.o \
gen164/4/in_has.o \
gen164/4/in_gas.o \
gen164/4/in_put.o \
gen164/4/in_tap.o \
gen164/4/by_gas.o \
gen164/4/by_get.o \
gen164/4/by_has.o \
gen164/4/by_put.o
J164_5_OFILES=\
gen164/5/cue.o \
gen164/5/jam.o \
gen164/5/mat.o \
gen164/5/mink.o \
gen164/5/parse.o \
2014-04-09 22:57:48 +04:00
gen164/5/repg.o \
gen164/5/rexp.o \
2014-01-07 00:37:42 +04:00
gen164/5/rub.o \
gen164/5/shax.o \
gen164/5/lore.o \
gen164/5/loss.o \
gen164/5/tape.o \
gen164/5/trip.o
J164_6_OFILES=\
gen164/6/al.o \
gen164/6/ap.o \
gen164/6/bull.o \
gen164/6/cell.o \
gen164/6/comb.o \
gen164/6/cons.o \
gen164/6/core.o \
gen164/6/cube.o \
gen164/6/face.o \
gen164/6/fitz.o \
gen164/6/flan.o \
gen164/6/flay.o \
gen164/6/flip.o \
gen164/6/flor.o \
gen164/6/fork.o \
gen164/6/hike.o \
gen164/6/look.o \
gen164/6/ut.o
J164_6_OFILES_UT=\
gen164/6/ut_burn.o \
gen164/6/ut_busk.o \
gen164/6/ut_bust.o \
gen164/6/ut_conk.o \
gen164/6/ut_crop.o \
gen164/6/ut_cull.o \
gen164/6/ut_find.o \
gen164/6/ut_fink.o \
gen164/6/ut_fire.o \
gen164/6/ut_firm.o \
gen164/6/ut_fish.o \
gen164/6/ut_fuse.o \
gen164/6/ut_gain.o \
gen164/6/ut_heal.o \
gen164/6/ut_lose.o \
gen164/6/ut_mint.o \
gen164/6/ut_moot.o \
gen164/6/ut_mull.o \
gen164/6/ut_nest.o \
gen164/6/ut_park.o \
gen164/6/ut_peek.o \
gen164/6/ut_play.o \
gen164/6/ut_repo.o \
gen164/6/ut_rest.o \
gen164/6/ut_seek.o \
gen164/6/ut_sift.o \
gen164/6/ut_swab.o \
gen164/6/ut_tack.o \
gen164/6/ut_tock.o \
gen164/6/ut_wrap.o
J164_OFILES=\
$(J164_1_OFILES) \
$(J164_2_OFILES) \
$(J164_3_OFILES) \
$(J164_4_OFILES) \
$(J164_5_OFILES) \
$(J164_6_OFILES) \
$(J164_6_OFILES_UT) \
gen164/watt.o
2013-09-29 00:21:18 +04:00
BASE_OFILES=\
$(F_OFILES) \
2014-01-07 00:37:42 +04:00
$(J164_OFILES)
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=\
2013-09-29 00:21:18 +04:00
v/ames.o \
v/batz.o \
2014-02-27 04:40:08 +04:00
v/cttp.o \
2013-09-29 00:21:18 +04:00
v/http.o \
v/loop.o \
v/main.o \
v/raft.o \
2013-09-29 00:21:18 +04:00
v/reck.o \
v/save.o \
v/sist.o \
2013-09-29 00:21:18 +04:00
v/time.o \
v/term.o \
v/unix.o \
2014-01-17 21:38:15 +04:00
v/walk.o
VERE_OFILES=\
$(V_OFILES) \
2013-09-29 00:21:18 +04:00
$(BASE_OFILES) \
$(OUT_OFILES)
LIBUV=outside/libuv/libuv.a
2014-04-09 22:57:48 +04:00
LIBCRE=outside/cre2/lib/libcre2.a
2013-09-29 00:21:18 +04:00
all: $(BIN)/vere
$(LIBUV):
2014-02-06 01:55:30 +04:00
$(MAKE) -C outside/libuv libuv.a
2014-04-09 22:57:48 +04:00
$(LIBCRE):
cd outside/cre2/src && sh build.sh
2014-01-17 21:38:15 +04:00
$(V_OFILES) f/loom.o f/trac.o: include/v/vere.h
2014-04-09 22:57:48 +04:00
$(BIN)/vere: $(LIBCRE) $(VERE_OFILES) $(LIBUV) $(CAPN)
2013-09-29 00:21:18 +04:00
mkdir -p $(BIN)
2014-04-09 22:57:48 +04:00
$(CLD) $(CLDOSFLAGS) -o $(BIN)/vere $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(CAPN) $(LIBS)
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')
clean:
$(RM) $(VERE_OFILES) $(BIN)/vere $(BIN)/eyre
$(MAKE) -C outside/libuv clean
2014-04-09 22:57:48 +04:00
cd outside/cre2/src && sh clean.sh
2013-09-29 00:21:18 +04:00