public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
al-skobelev (author)
Mon Sep 15 23:18:44 -0700 2008
commit  231a6e53c0a58eee4ca41bf44f5286c523e882d9
tree    47abbea5f43f8f83e53a38bb5598a806a163f13d
parent  f5b182b332b28c1eed00c6cd8e3f70f33be0e9f1
nu / Makefile
100644 65 lines (50 sloc) 1.646 kb
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
56
57
58
59
60
61
62
63
64
65
#
# This Makefile is used to bootstrap Nu.
# Use it to build "mininush", a simpler and statically-linked
# version of nush, the Nu shell.
#
 
PREFIX?=/usr/local
 
ifeq ($(shell test -e /usr/lib/libffi.dylib && echo yes), yes)
  # Use the libffi that ships with OS X.
  FFI_LIB=-L/usr/lib -lffi
  FFI_INCLUDE=-I /usr/include/ffi
else
  # Use the libffi that is distributed with Nu.
  FFI_LIB=-L./libffi -lffi
  FFI_INCLUDE=-I ./libffi/include
endif
 
ifeq ($(shell test -e $(PREFIX)/lib/libpcre.dylib && echo yes), yes)
  # Use already-installed PCRE.
  PCRE_LIB=-L$(PREFIX)/lib -lpcre
  PCRE_INCLUDE=-I $(PREFIX)/include
else
  # Use PCRE in the Nu directory.
  PCRE_LIB=-Lpcre-7.5/.libs -lpcre
  PCRE_INCLUDE=-I pcre-7.5
endif
 
INCLUDES=$(FFI_INCLUDE) $(PCRE_INCLUDE) -I./include/Nu
LIBS=-lobjc -lreadline $(PCRE_LIB) $(FFI_LIB)
CFLAGS=-g -O2 -Wall -DDARWIN -DMACOSX -DMININUSH -std=gnu99 -DLEOPARD_OBJC2
MFLAGS=-fobjc-exceptions
LDFLAGS=-framework Cocoa $(LIBS)
 
# FIXME add PREFIX/lib and PREFIX/include if they exist
 
OBJS=$(patsubst %.m,%.o, $(wildcard objc/*.m)) $(patsubst %.c,%.o, $(wildcard objc/*.c))
 
all: nush
 
.m.o:
  gcc $(CFLAGS) $(MFLAGS) $(INCLUDES) -c $< -o $@
 
.c.o:
  gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
 
.PHONY: nush
nush: mininush
  mininush tools/nuke
 
mininush: $(OBJS)
  gcc $(OBJS) $(CFLAGS) $(MFLAGS) $(INCLUDES) main/main.m -o $@ $(LDFLAGS)
  install_name_tool -change /usr/local/lib/libpcre.0.dylib pcre-7.5/.libs/libpcre.0.dylib $@
 
# These actions assume that nush and nuke are installed somewhere safe, such as /usr/local/bin
 
.PHONY: clean
clean:
  rm -f objc/*.o mininush
  nuke clean
 
.PHONY: clobber
clobber: clean
  nuke clobber