Makefile 659 Bytes
Newer Older
1
2
3
4
5
6
# define main target
PROG = py
all: $(PROG)

# include py core make definitions
include ../py/py.mk
7

8
9
10
11
# program for deletion
RM = /bin/rm

# compiler settings
12
CC = gcc
13
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -Os #-DNDEBUG
14
LDFLAGS = -lm
15

16
# source files
17
18
SRC_C = \
	main.c \
19
	file.c \
20

21
OBJ = $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) $(PY_O)
Damien's avatar
Damien committed
22
LIB = -lreadline
23
24
# the following is needed for BSD
#LIB += -ltermcap
25
26
27

$(PROG): $(BUILD) $(OBJ)
	$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
28
29
	strip $(PROG)
	size $(PROG)
30
31
32
33

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

34
$(BUILD)/main.o: mpconfigport.h
35
36

clean:
37
38
	$(RM) -f $(PROG)
	$(RM) -rf $(BUILD)
39

40
.PHONY: all clean