# Common make definitions, customized for each platform
|
|
# Definitions required in all program directories to compile and link
|
# C programs using gcc.
|
|
CC=g++
|
COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) -c
|
LINK.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
LDFLAGS=
|
LDDIR += -L$(ROOT)/lib
|
LDLIBS += $(LDDIR) $(EXTRALIBS)
|
INCLUDE += -I. -I./include -I$(ROOT)/include -I$(ROOT)/include/usgcommon
|
|
ifeq ($(DEBUG),y)
|
DEBFLAGS = -O -g # "-O" is needed to expand inlines
|
else
|
DEBFLAGS = -O2
|
endif
|
|
CFLAGS=-ansi -mcx16 $(INCLUDE) $(DEBFLAGS) -std=c++11 -Wall -DMACOS -D_DARWIN_C_SOURCE $(EXTRA)
|
RANLIB=ranlib
|
AR=ar
|
AWK=awk
|
|
# Common temp files to delete from each directory.
|
TEMPFILES=core core.* **/*.o temp.* *.out *.a *.so
|
|
|
%: %.c
|
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
|