summaryrefslogtreecommitdiff
path: root/Makefile
blob: 444323d5ff2101567b0a7f3dd8add969cae31737 (plain) (blame)
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
PROJECT=ihe
CC=gcc
CFLAGS=-I./
SOURCES=buf.c core.c
SOURCES+=$(wildcard cmd/*.c)
OBJECTS=$(SOURCES:.c=.o) 
LIB_OBJECTS=libcmd/libcmd.o libterm/libterm.o

all: clean $(OBJECTS) $(PROJECT)

$(PROJECT):
	$(CC) -c $(PROJECT).c 
	ld -r $(OBJECTS) $(PROJECT).o -o $(PROJECT)_.o
	
	$(CC) $(CFLAGS) $(PROJECT)_.o $(LIB_OBJECTS)  -o $(PROJECT)

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

clean:
	rm -f $(PROJECT)
	rm -f *.o

leak:
	valgrind --leak-check=full --track-origins=yes --log-file=log.txt ./ihe