"Fossies" - the Fresh Open Source Software Archive

Member "replace-2.24/Makefile.cln" (4 Apr 2007, 2084 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 ifeq ($(HAVE_GCC),)
   40 
   41 # HP-UX ANSI C compiler flags
   42 CC = cc
   43 CFLAGS = -O -Ae +w1 -z -DHAVE_LONG_LONG
   44 LDFLAGS = $(CFLAGS)
   45 
   46 else 
   47 # HP-UX GNU C compiler flags 
   48 CC = gcc CFLAGS = $(COMMON_GCC_FLAGS) -D_HPUX_SOURCE 
   49 endif 
   50 
   51 endif
   52 
   53 CFLAGS += $(DEFINES)
   54 
   55 $(PROGRAM): $(OBJS)
   56 	$(CC) $(LDFLAGS) -o $@ $(OBJS)
   57 
   58 install: $(PROGRAM) $(PROGRAM).1
   59 	-if [ ! -d $(TREE) ]; then mkdir $(TREE); chmod a+rx $(TREE); fi
   60 	-if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); chmod a+rx $(BINDIR); fi
   61 	-if [ ! -d $(MANTREE) ]; then mkdir $(MANTREE); chmod a+rx $(MANTREE); fi
   62 	-if [ ! -d $(MANDIR) ]; then mkdir $(MANDIR); chmod a+rx $(MANDIR); fi
   63 	-cp $(PROGRAM) $(BINDIR)
   64 	-strip $(BINDIR)/$(PROGRAM)
   65 	-cp $(PROGRAM).1 $(MANDIR)
   66 	-chmod a+r $(MANDIR)/$(PROGRAM).1
   67 
   68 binary.o: $(PROGRAM).h
   69 init.o: $(PROGRAM).h
   70 $(PROGRAM).o: $(PROGRAM).h
   71 text.o: $(PROGRAM).h
   72 
   73 test check: $(PROGRAM) tests/runtests
   74 	@cd tests; ./runtests
   75 
   76 verbosetest verbosecheck: $(PROGRAM) tests/runtests
   77 	@cd tests; ./runtests 1
   78 
   79 clean:
   80 	/bin/rm -f $(OBJS) a.out $(PROGRAM) core *.cln tests/*.failed tests/test004.old
   81 
   82 lint splint: $(SRCS)
   83 	$(LINT) $(LINTFLAGS) $(SRCS) 2>&1 | $(PAGER)