"Fossies" - the Fresh Open Source Software Archive

Member "ms-sys-2.7.0/Makefile" (20 Jun 2020, 4609 Bytes) of package /linux/privat/ms-sys-2.7.0.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. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile": 2.4.1_vs_2.6.0.

    1 # Generic GNU Makefile with Native Language Support
    2 # written by Henrik Carlqvist
    3 # 
    4 # Possible targets are:
    5 # make                    normal compile
    6 # make all                normal compile, the same as above
    7 # make install            installs compiled files
    8 # make uninstall          removes installed files
    9 # make clean              removes compiled files
   10 # make mrproper           removes compiled files and dependencies
   11 # make debug              compiles with flag -g for debuggers
   12 # make messages           creates po/messages.po as a skeleton for NLS
   13 #
   14 # Contributors: Henrik Carlqvist
   15 #               Alon Bar-Lev
   16 
   17 # Name of program, compiled executable file
   18 PACKAGE = ms-sys
   19 
   20 # Add anything extra you might need when comipiling below
   21 # Example: EXTRA_CFLAGS = -D MY_DEFINE=1
   22 
   23 # The row below is a workaround for systems which lack libintl.h
   24 EXTRA_CFLAGS = -idirafter include-fallback -D_FILE_OFFSET_BITS=64
   25 
   26 # Add anything extra you might need when linking below
   27 # Example: EXTRA_LDFLAGS = -lm
   28 EXTRA_LDFLAGS =
   29 
   30 # Paths
   31 
   32 # Installation path
   33 PREFIX ?= /usr/local
   34 BINDIR = $(PREFIX)/bin
   35 LOCALEDIR = $(PREFIX)/share/locale
   36 MANDIR = $(PREFIX)/man
   37 
   38 # Where your .c-files live
   39 SRC = src
   40 # Where your .h-files live
   41 INC = inc
   42 # Where .d-files will be created for dependencies
   43 DEP = build/dep
   44 # Where any .po-files live for native language support, eg sv_SE.po or de_DE.po
   45 # A skeleton .po-file could be created by "make messages"
   46 PO  = po
   47 # Where your man-pages live
   48 MAN = man
   49 # Where .mo-files will be created
   50 MO  = build/mo
   51 # Where .o-files will be created
   52 OBJ = build/obj
   53 # Where your program will be created before installation
   54 BIN = build/bin
   55 
   56 # There is no need to change anything below this line
   57 #***********************************************************************
   58 
   59 # Used for Native Language Support, do not change!
   60 MESSDIR = LC_MESSAGES
   61 
   62 INCDIRS = $(INC)
   63 
   64 CC ?= gcc
   65 INCLUDES = $(INCDIRS:%=-I %)
   66 
   67 ifeq ($(MAKECMDGOALS),debug)
   68 CFLAGS ?= -O0 -g
   69 endif
   70 
   71 CFLAGS ?= -O2
   72 CFLAGS += -ansi -pedantic -Wall -c $(INCLUDES) \
   73          -D PACKAGE=\"$(PACKAGE)\" -D LOCALEDIR=\"$(LOCALEDIR)\" \
   74           $(EXTRA_CFLAGS)
   75 LDFLAGS += $(EXTRA_LDFLAGS)
   76 
   77 
   78 SRC_FILES = $(wildcard $(SRC)/*.c)
   79 INC_FILES = $(wildcard $(INC)/*.h)
   80 
   81 MESSAGES = $(PO)/messages.po
   82 
   83 MAN_SRC = $(wildcard $(MAN)/*.* $(MAN)/??/*.*)
   84 
   85 PO_FILES = $(filter-out $(MESSAGES),$(wildcard $(PO)/*.po))
   86 MO_FILES = $(PO_FILES:$(PO)/%.po=$(MO)/%.mo)
   87 LANGUAGES ?= $(PO_FILES:$(PO)/%.po=%)
   88 NLS_FILES = $(LANGUAGES:%=$(DESTDIR)$(LOCALEDIR)/%/$(MESSDIR)/$(PACKAGE).mo)
   89 MAN_FILES = $(foreach FILE, $(MAN_SRC), \
   90             $(DESTDIR)$(subst $(MAN),$(MANDIR),$(dir $(FILE)))man$(subst .,,$(suffix $(FILE)))/$(notdir $(FILE)))
   91 GZIP_FILES = $(foreach FILE, $(MAN_SRC), \
   92             $(DESTDIR)$(subst $(MAN),$(MANDIR),$(dir $(FILE)))man$(subst .,,$(suffix $(FILE)))/$(subst .1,.1.gz,$(notdir $(FILE))))
   93 
   94 FILES = $(SRC_FILES:$(SRC)/%.c=%)
   95 
   96 OBJS = $(FILES:%=$(OBJ)/%.o)
   97 DEPS = $(FILES:%=$(DEP)/%.d)
   98 
   99 all debug: $(BIN)/$(PACKAGE) $(MO_FILES)
  100 
  101 install: $(DESTDIR)$(BINDIR)/$(PACKAGE) $(NLS_FILES) $(MAN_FILES)
  102 
  103 uninstall:
  104 	$(RM) $(DESTDIR)$(BINDIR)/$(PACKAGE) $(NLS_FILES) $(GZIP_FILES)
  105 
  106 messages: $(MESSAGES)
  107 
  108 mrproper: clean
  109 	$(RM) $(DEP)/*.d
  110 	$(RM) $(OS_CHECK)
  111 
  112 clean:
  113 	$(RM) $(MESSAGES)
  114 	$(RM) $(MO)/*.mo
  115 	$(RM) $(OBJ)/*.o
  116 	$(RM) $(LIB)/*.a
  117 	$(RM) $(filter-out $(BIN)/CVS,$(wildcard $(BIN)/*))
  118 
  119 $(DESTDIR)$(BINDIR)/%: $(BIN)/%
  120 	install -d $(@D)
  121 	install -m 755 $^ $@
  122 
  123 $(DESTDIR)$(LOCALEDIR)/%/$(MESSDIR)/$(PACKAGE).mo: $(MO)/%.mo
  124 	mkdir -p $(DESTDIR)$(LOCALEDIR)/$*/$(MESSDIR)
  125 	install -m 644 $^ $@
  126 
  127 $(DESTDIR)$(MANDIR)/%: $(MAN)/$(dir $(*D))/$(*F)
  128 	install -d $(@D)
  129 	install -m 644 $(MAN)/$(dir $(*D))$(*F) $@
  130 	gzip --no-name -f $@
  131 
  132 #$(DESTDIR)$(MANDIR)/%: $(MAN)/$(*F)
  133 #	echo t: $<
  134 #	install -D -m 644 $(MAN)/$(*F) $@
  135 
  136 $(BIN)/%: $(OBJS)
  137 	$(CC) -o $@ $^ $(LDFLAGS)
  138 
  139 $(MESSAGES): $(SRC_FILES) $(INC_FILES)
  140 	xgettext -k_ -o$@ $^
  141 
  142 $(OBJS): $(OBJ)/%.o: $(SRC)/%.c $(DEP)/%.d \
  143                       $(filter-out $(wildcard $(OBJ)), $(OBJ)) \
  144                       $(filter-out $(wildcard $(BIN)), $(BIN))
  145 	$(CC) $(CFLAGS) -o $@ $<
  146 
  147 $(MO_FILES): $(MO)/%.mo: $(PO)/%.po $(filter-out $(wildcard $(MO)), $(MO))
  148 	msgfmt -o $@ $<
  149 
  150 $(DEPS): $(DEP)/%.d: $(SRC)/%.c $(filter-out $(wildcard $(DEP)), $(DEP))
  151 ifeq ($(MAKECMDGOALS),quiet)
  152 	@$(CC) -MM $(CFLAGS) -MT $@ $< > $@
  153 else
  154 	$(CC) -MM $(CFLAGS) -MT $@ $< > $@
  155 endif
  156 
  157 ifneq ($(MAKECMDGOALS),mrproper)
  158 ifneq ($(wildcard $(DEPS)),)
  159 include $(wildcard $(DEPS))
  160 endif
  161 endif
  162 
  163 # Create directories which might be lost from CVS
  164 $(DEP) $(OBJ) $(BIN) $(MO):
  165 	mkdir -p $@
  166 
  167 # Used to force some rules to always be compiled
  168 FORCE: ;
  169 
  170