Roland Ver. 4.5 Technical Information Seite 104

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 212
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 103
94 GNU make
PROGRAMS = server client
server_OBJS = server.o server_priv.o server_access.o
server_LIBS = priv protocol
client_OBJS = client.o client_api.o client_mem.o
client_LIBS = protocol
# Everything after this is generic
.PHONY: all
all: $(PROGRAMS)
define PROGRAM_template =
$(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
ALL_OBJS += $$($(1)_OBJS)
endef
$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
$(PROGRAMS):
$(LINK.o) $^ $(LDLIBS) -o $@
clean:
rm -f $(ALL_OBJS) $(PROGRAMS)
8.10 The origin Function
The origin function is unlike most other functions in that it does not operate on the values
of variables; it tells you something about a variable. Specifically, it tells you where it came
from.
The syntax of the origin function is:
$(origin variable)
Note that variable is the name of a variable to inquire about, not a reference to that
variable. Therefore you would not normally use a $ or parentheses when writing it. (You
can, however, use a variable reference in the name if you want the name not to be a
constant.)
The result of this function is a string telling you how the variable variable was defined:
undefined
if variable was never defined.
default
if variable has a default definition, as is usual with CC and so on. See Section 10.3
[Variables Used by Implicit Rules], page 115. Note that if you have redefined a
default variable, the origin function will return the origin of the later definition.
Seitenansicht 103
1 2 ... 99 100 101 102 103 104 105 106 107 108 109 ... 211 212

Kommentare zu diesen Handbüchern

Keine Kommentare