~brenns10/funlisp

ref: 7347d0eca6d0a50799d3048c21f376277e827224 funlisp/Makefile -rw-r--r-- 946 bytes
7347d0ecStephen Brennan Updates for readthedocs 3 years ago
                                                                                
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
# funlisp - Makefile
#
# Stephen Brennan <stephen@brennan.io>

.PHONY: all clean doc

CC=gcc
CFLAGS= -std=c89 -Wall -Wextra -fPIC -Iinc -c
SRCS=$(wildcard src/*.c)
OBJS=$(patsubst src/%.c,obj/%.o,$(SRCS))

# Debug mode (make D=1): adds "debugging symbols" etc
D=0
ifeq ($(D),1)
CFLAGS += -g -DDEBUG
endif

all: bin/libfunlisp.a

obj/%.o: src/%.c
	$(CC) $(CFLAGS) -c $< -o $@

obj/%.o: tools/%.c
	$(CC) $(CFLAGS) -c $< -o $@

bin/libfunlisp.a: $(OBJS)
	ar rcs $@ $^

bin/repl: obj/repl.o bin/libfunlisp.a
	$(CC) -ledit $^ -o $@

bin/hello_repl: obj/hello_repl.o bin/libfunlisp.a
	$(CC) -ledit $^ -o $@

bin/runfile:  obj/runfile.o bin/libfunlisp.a
	$(CC) $^ -o $@

bin/call_lisp: obj/call_lisp.o bin/libfunlisp.a
	$(CC) $^ -o $@

clean:
	rm -rf obj/* bin/* doc/xml
	make -C doc clean

doc:
	doxygen
	make -C doc html


depend: $(SRCS) src/*.h inc/*.h tools/*.c
	$(CC) $(CFLAGS) -MM obj $(SRCS) | sed 's!^\(.*\):!obj/\1:!' > depend

include depend