Makefile 724 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
# program for deletion
RM = /bin/rm
Dave Hylands's avatar
Dave Hylands committed
10
ECHO = @echo
11
12

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

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

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

$(PROG): $(BUILD) $(OBJ)
Dave Hylands's avatar
Dave Hylands committed
28
29
30
31
	$(ECHO) "LINK $<"
	$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
	$(Q)strip $(PROG)
	$(Q)size $(PROG)
32
33

$(BUILD)/%.o: %.c
Dave Hylands's avatar
Dave Hylands committed
34
35
	$(ECHO) "CC $<"
	$(Q)$(CC) $(CFLAGS) -c -o $@ $<
36

37
$(BUILD)/main.o: mpconfigport.h
38
39

clean:
40
41
	$(RM) -f $(PROG)
	$(RM) -rf $(BUILD)
42

43
.PHONY: all clean