1VERSION := 3 2SUBVERSION := 1 3MINORVERSION := 5 4TARVERSION := 3.1.5 5LIBVERSION := 3.1.5 6 7ldconfig := ldconfig 8ln_f := ln -f 9ln_sf := ln -sf 10 11 12CURSES := -lncurses 13 14LDFLAGS += -Wl,-warn-common 15 16CFLAGS += -I/usr/include -w -D_GNU_SOURCE -O2 -g3 -fno-common -ffast-math -I proc \ 17 -W -Wall -Wshadow -Wcast-align -Wredundant-decls \ 18 -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return \ 19# -Wpadded -Wunreachable-code -Wdisabled-optimization \ 20 -Wstrict-prototypes -Wmissing-prototypes # -Wconversion 21 22 23all: do_all 24 25-include */module.mk 26 27do_all: top 28 29clean: 30 rm -f top top.o proc/libproc.* proc/*.o 31 32###### install 33 34ifeq ($(LIB_DIR),) 35LIB_DIR=/lib 36endif 37 38install: 39 @set -e; ln -f top ../../testcases/bin 40 @set -e; cp -f proc/libproc.so.$(LIBVERSION) $(LIB_DIR) 41 @set -e; ln -fs $(LIB_DIR)/libproc.so.$(LIBVERSION) $(LIB_DIR)/libproc.so 42 43############ prog.c --> prog.o 44 45%.o : %.c 46 @set -e;$(CC) $(CFLAGS) -c -o $@ $^ 47 48############ prog.o --> prog 49 50top: % : %.o $(LIBPROC) 51 @set -e;$(CC) $(LDFLAGS) -o $@ $^ $(CURSES) 52 53 54