"Fossies" - the Fresh Open Source Software Archive

Member "replace-2.24/Makefile" (4 Apr 2007, 1967 Bytes) of package /linux/privat/old/replace-2.24-src-11.11.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # This Makefile requires GNU make in case you didn't realise...
    2 
    3 OS := $(shell uname -s)
    4 
    5 SRCS = auto.c binary.c init.c replace.c text.c
    6 OBJS = auto.o binary.o init.o replace.o text.o
    7 
    8 PROGRAM = replace
    9 
   10 TREE = /usr/local
   11 BINDIR = $(TREE)/bin
   12 MANTREE = $(TREE)/man
   13 MANDIR = $(MANTREE)/man1
   14 
   15 DEFINES = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
   16 #COMMON_GCC_FLAGS = -O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Waggregate-return -Wnested-externs -Wlong-long -Winline -DHAVE_LONG_LONG
   17 COMMON_GCC_FLAGS = -O -I/usr/local/include -DHAVE_LONG_LONG 
   18 
   19 ifeq ($(OS),Linux)
   20 
   21 # Linux C compiler flags
   22 CC = cc
   23 CFLAGS_SOURCE = -D_GNU_SOURCE
   24 # -D_BSD_SOURCE -D_POSIX_SOURCE
   25 CFLAGS = $(COMMON_GCC_FLAGS) $(CFLAGS_SOURCE) 
   26 LINT = splint
   27 LINTFLAGS = $(DEFINES) $(CFLAGS_SOURCE) -D__linux__ -DHAVE_LONG_LONG +posixlib -unrecog -weak
   28 PAGER = less
   29 
   30 endif
   31 
   32 ifeq ($(OS),HP-UX)
   33 
   34 HAVE_GCC := $(shell gcc --version 2>/dev/null)
   35 LINT = lint
   36 LINTFLAGS = $(DEFINES) -Ae
   37 PAGER = more
   38 
   39 
   40 # HP-UX ANSI C compiler flags
   41 CC = cc
   42 CFLAGS = -O -Ae +w1 -z -DHAVE_LONG_LONG
   43 LDFLAGS = $(CFLAGS)
   44 
   45 
   46 endif
   47 
   48 CFLAGS += $(DEFINES)
   49 
   50 $(PROGRAM): $(OBJS)
   51 	$(CC) $(LDFLAGS) -o $@ $(OBJS)
   52 
   53 install: $(PROGRAM) $(PROGRAM).1
   54 	-if [ ! -d $(TREE) ]; then mkdir $(TREE); chmod a+rx $(TREE); fi
   55 	-if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); chmod a+rx $(BINDIR); fi
   56 	-if [ ! -d $(MANTREE) ]; then mkdir $(MANTREE); chmod a+rx $(MANTREE); fi
   57 	-if [ ! -d $(MANDIR) ]; then mkdir $(MANDIR); chmod a+rx $(MANDIR); fi
   58 	-cp $(PROGRAM) $(BINDIR)
   59 	-strip $(BINDIR)/$(PROGRAM)
   60 	-cp $(PROGRAM).1 $(MANDIR)
   61 	-chmod a+r $(MANDIR)/$(PROGRAM).1
   62 
   63 binary.o: $(PROGRAM).h
   64 init.o: $(PROGRAM).h
   65 $(PROGRAM).o: $(PROGRAM).h
   66 text.o: $(PROGRAM).h
   67 
   68 test check: $(PROGRAM) tests/runtests
   69 	@cd tests; ./runtests
   70 
   71 verbosetest verbosecheck: $(PROGRAM) tests/runtests
   72 	@cd tests; ./runtests 1
   73 
   74 clean:
   75 	/bin/rm -f $(OBJS) a.out $(PROGRAM) core *.cln tests/*.failed tests/test004.old
   76 
   77 lint splint: $(SRCS)
   78 	$(LINT) $(LINTFLAGS) $(SRCS) 2>&1 | $(PAGER)