-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
69 lines (54 loc) · 1.42 KB
/
Makefile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
##
## Makefile for logtop
##
## Made by julien palard
## Login <[email protected]>
##
VERSION = 0.7.0
MINOR = 0
RELEASE = 0
NAME = logtop
UNAME=$(shell uname -s)
ifeq ($(UNAME),Darwin)
LINKERNAME = lib$(NAME).dylib
else
LINKERNAME = lib$(NAME).so
endif
SONAME=$(LINKERNAME).$(VERSION)
REALNAME=$(SONAME).$(MINOR).$(RELEASE)
LIB_SRC = src/avl.c src/history.c \
src/logtop.c src/libavl/avl.c
SRC = $(LIB_SRC) src/curses.c src/stdout.c src/main.c
LIB_OBJ = $(LIB_SRC:.c=.o)
OBJ = $(SRC:.c=.o)
CC = gcc
override INCLUDE += .
LIB = $(shell pkg-config --libs ncursesw) #-lefence
CFLAGS += -O3 -Wall -fPIC -Wextra -pedantic -Wstrict-prototypes -I$(INCLUDE) $(shell pkg-config --cflags ncursesw)
RM = rm -fr
LDFLAGS =
$(NAME): $(OBJ)
$(CC) -o $(NAME) $(OBJ) $(LIB) $(LDFLAGS)
lib$(NAME): $(LIB_OBJ)
$(CC) $(CFLAGS) --shared -o $(LINKERNAME) $(OBJ) $(LIB) $(LDFLAGS)
install: $(NAME)
mkdir -p $(DESTDIR)/usr/bin/
cp $(NAME) $(DESTDIR)/usr/bin/
python-module:
swig -python *.i
python ./setup.py build_ext --inplace
python3-module:
swig -python *.i
python3 ./setup.py build_ext --inplace
all:
@make $(NAME)
@make lib$(NAME)
.c.o:
$(CC) -c $(CFLAGS) $< -o $(<:.c=.o)
clean:
$(RM) $(NAME) src/*~ src/#*# src/*.o src/*.core \
src/libavl/*.o _logtop.* liblogtop.* \
logtop.py *.pyc build/ logtop_wrap.c
re: clean all
check-syntax:
gcc -Isrc -Wall -Wextra -ansi -pedantic -o /dev/null -S ${CHK_SOURCES}