From 3dc56e3425c0cc41caee9ac33c60204cb8cbf8c9 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Tue, 28 Sep 2010 11:16:34 -0400 Subject: Work around old GNU make's inability to use "else if" --- make/template/main.mk | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/make/template/main.mk b/make/template/main.mk index e92006b3e..9ae142cb5 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -37,34 +37,42 @@ INSTMODE_LIB = 0644 @IFEQ $(SYSTEM) linux LDLIBS += -ldl -lrt -@ELSIFEQ $(SYSTEM) solaris +@ENDIF +@IFEQ $(SYSTEM) solaris LDLIBS += -lsocket -lnsl -lrt -lresolv -@ELSIFEQ $(SYSTEM) sunos +@ENDIF +@IFEQ $(SYSTEM) sunos LDLIBS += -lsocket -lnsl -lrt -lresolv -@ELSIFEQ $(SYSTEM) darwin +@ENDIF +@IFEQ $(SYSTEM) darwin CXXFLAGS += -DDARWIN -frtti LDLIBS += -ldl CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS) PICLDFLAGS = -fPIC -shared -bundle -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS) -@ELSIFEQ $(SYSTEM) interix +@ENDIF +@IFEQ $(SYSTEM) interix CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include -@ENDIF +@ENDIF @IFNDEF D D=0 @ENDIF +DBGOK=0 @IFEQ $(D) 0 CXXFLAGS += -O2 -g1 HEADER = std-header -@ELSIFEQ $(D) 1 + DBGOK=1 +@ENDIF +@IFEQ $(D) 1 CXXFLAGS += -O0 -g3 -Werror HEADER = debug-header -@ELSIFEQ $(D) 2 + DBGOK=1 +@ENDIF +@IFEQ $(D) 2 CXXFLAGS += -O2 -g3 HEADER = debug-header -@ELSE - HEADER = unknown-debug-level + DBGOK=1 @ENDIF FOOTER = finishmessage @@ -109,6 +117,10 @@ TARGET = all TARGET = $(T) @ENDIF +@IFEQ $(DBGOK) 0 + HEADER = unknown-debug-level +@ENDIF + all: $(FOOTER) target: $(HEADER) -- cgit v1.2.3