public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
timburks (author)
Mon Jan 28 07:43:45 -0800 2008
commit  6ff609b1ba6360528f314479b6c0e264d5c74554
tree    b3cfa68d06aad48615e0a5579ce21551691c404e
parent  7989745269899a7e7186e62071a6b1018a376470
nu / Makefile
100644 55 lines (42 sloc) 1.377 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
#
# 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)
LIBS=-lobjc -lreadline $(PCRE_LIB) $(FFI_LIB)
CFLAGS=-g -O2 -Wall -DMACOSX -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: mininush
 
.m.o:
  gcc $(CFLAGS) $(MFLAGS) $(INCLUDES) -c $< -o $@
 
.c.o:
  gcc $(CFLAGS) $(INCLUDES) -c $< -o $@
 
mininush: $(OBJS)
  gcc $(OBJS) $(CFLAGS) -o $@ $(LDFLAGS)
  install_name_tool -change /usr/local/lib/libpcre.0.dylib pcre-7.5/.libs/libpcre.0.dylib $@
 
.PHONY: clean
clean:
  rm -f objc/*.o mininush