[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot / beos

Annotation of OpenXM_contrib/gnuplot/beos/Makefile, Revision 1.1.1.1

1.1       ohara       1: ## BeOS Generic Makefile v2.0b3 ##
                      2:
                      3: ## Fill in the top section of this makefile to define exactly what sort of
                      4: ## binary you are creating, and what sources, resources and libraries are
                      5: ## needed to create it.  The makefile will then determine the proper
                      6: ## platform specific options.
                      7:
                      8: ## Fill in the top section to define the binary being created and the makefile
                      9: ## will make sure that all of the hard work is taken care of for you, for both
                     10: ## PowerPC and Intel versions of the BeOS.
                     11:
                     12: ## Application Specific Settings ---------------------------------------------
                     13:
                     14: # specify the name of the binary
                     15: NAME= gnuplot_be
                     16:
                     17: # specify the type of binary
                     18: #      APP:    Application
                     19: #      SHARED: Shared library or add-on
                     20: #      STATIC: Static library archive
                     21: #      DRIVER: Kernel Driver
                     22: TYPE= APP
                     23:
                     24: # specify the source files to use
                     25: #      full paths or paths relative to the makefile can be included
                     26: #      all files, regardless of directory, will have their object
                     27: #      files created in the common object directory.
                     28: #      Note that this means this makefile will not work correctly
                     29: #      if two source files with the same name (source.c or source.cpp)
                     30: #      are included from different directories.  Also note that spaces
                     31: #      in folder names do not work well with this makefile.
                     32: SOURCES= GPApp.cpp GPWindow.cpp GPView.cpp GPBitmap.cpp
                     33:
                     34: HEADERS= GPApp.h GPBitmap.h GPView.h GPWindow.h XStringList.h constants.h
                     35:
                     36: EXTRA_DIST= Makefile XStringList.cpp
                     37:
                     38: # specify the resource files to use
                     39: #      full path or a relative path to the resource file can be used.
                     40: RSRCS= gnuplot_be.rsrc
                     41:
                     42: #specify additional libraries to link against
                     43: #      if libName.so or libName.a is the name of the library to link against
                     44: #      then simply specify Name in the LIBS list
                     45: #      if there is another naming scheme use the full binary
                     46: #      name: my_library.so or my_lib.a
                     47: #      libroot.so never needs to be specified here, although libbe.so does
                     48: LIBS= be tracker
                     49:
                     50:
                     51: #      specify the paths to directories where additional
                     52: #      libraries are to be found.  /boot/develop/lib/PLATFORM/ is
                     53: #      already set.  The paths can be full or relative to this
                     54: #      makefile.  The paths included may not be recursive, so
                     55: #      specify all of the needed paths explicitly
                     56: #      Directories containing source-files are automatically added.
                     57: LIBPATHS=
                     58:
                     59: #      specify additional directories where header files can be found
                     60: #      directories where sources are found are included automatically
                     61: #      included.
                     62: INCPATHS=
                     63:
                     64: #      specify the level of optimization that you desire
                     65: #      NONE, SOME, FULL
                     66: OPTIMIZE= NONE
                     67:
                     68: #      specify any symbols to be defined.  The symbols will be
                     69: #      set to a value of 1.  For example specify DEBUG if you want
                     70: #      DEBUG=1 to be set when compiling.
                     71: DEFINES=
                     72:
                     73: #      specify special warning levels
                     74: #      if unspecified default warnings will be used
                     75: #      NONE = supress all warnings
                     76: #      ALL = enable all warnings
                     77: WARNINGS =
                     78:
                     79: #      specify symbols
                     80: #      if TRUE debug symbols will be created
                     81: SYMBOLS = TRUE
                     82:
                     83:
                     84: #      specify debug settings
                     85: #      if TRUE will allow application to be run from
                     86: #      the debugger
                     87: DEBUGGER = TRUE
                     88:
                     89:
                     90: ## Generic Makefile Rules ---------------------------
                     91: ##     DO NOT MODIFY BENEATH THIS LINE -----------------
                     92:
                     93: #      determine wheather running on x86 or ppc
                     94: MACHINE=$(shell uname -m)
                     95: ifeq ($(MACHINE), BePC)
                     96:        CPU = x86
                     97: else
                     98:        CPU = ppc
                     99: endif
                    100:
                    101: #      set the directory where object files and binaries will be created
                    102:        OBJ_DIR         := obj.$(CPU)
                    103:
                    104: #      specify that the binary should be created in the object directory
                    105:        TARGET          := $(NAME)
                    106:
                    107: #      specify the mimeset tool
                    108:        MIMESET         := mimeset
                    109:
                    110: # specify the tools for adding and removing resources
                    111:        XRES            = xres
                    112:
                    113:
                    114: #      platform specific settings
                    115:
                    116: #      x86 Settings
                    117: ifeq ($(CPU), x86)
                    118: #      set the compiler and compiler flags
                    119:        CC              =       gcc
                    120:
                    121: #      SETTING: set the CFLAGS for each binary type
                    122:        ifeq ($(TYPE), DRIVER)
                    123:                CFLAGS  += -no-fpic
                    124:        else
                    125:                CFLAGS +=
                    126:        endif
                    127:
                    128: #      SETTING: set the proper optimization level
                    129:        ifeq ($(OPTIMIZE), FULL)
                    130:                OPTIMIZER       = -O3
                    131:        else
                    132:        ifeq ($(OPTIMIZE), SOME)
                    133:                OPTIMIZER       = -O1
                    134:        else
                    135:        ifeq ($(OPTIMIZE), NONE)
                    136:                OPTIMIZER       = -O0
                    137:        else
                    138: #              OPTIMIZE not set so set to full
                    139:                OPTIMIZER       = -O3
                    140:        endif
                    141:        endif
                    142:        endif
                    143:
                    144:
                    145:
                    146: #      SETTING: set proper debugger flags
                    147:        ifeq ($(DEBUGGER), TRUE)
                    148:                DEBUG = -gdwarf-2
                    149:                OPTIMIZER = -O0
                    150:        endif
                    151:
                    152:        CFLAGS += $(OPTIMIZER) $(DEBUG)
                    153:
                    154: #      SETTING: set warning level
                    155:        ifeq ($(WARNINGS), ALL)
                    156:                CFLAGS += -Wall -Wno-multichar -Wno-ctor-dtor-privacy
                    157:        else
                    158:        ifeq ($(WARNINGS), NONE)
                    159:                CFLAGS +=
                    160:        endif
                    161:        endif
                    162:
                    163: #      set the linker and linker flags
                    164:        LD                      = gcc
                    165:        LDFLAGS         += $(DEBUG)
                    166:
                    167: #      SETTING: set linker flags for each binary type
                    168:        ifeq ($(TYPE), APP)
                    169:                LDFLAGS += -Xlinker -soname=_APP_
                    170:        else
                    171:        ifeq ($(TYPE), SHARED)
                    172:                LDFLAGS += -nostart -Xlinker -soname=$(NAME)
                    173:        else
                    174:        ifeq ($(TYPE), DRIVER)
                    175:                LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_
                    176:        endif
                    177:        endif
                    178:        endif
                    179:
                    180: #      SETTING: define debug symbols if desired
                    181:        ifeq ($(SYMBOLS), TRUE)
                    182:                CFLAGS += -g
                    183:        endif
                    184:
                    185:
                    186: else
                    187:
                    188: #      ppc Settings
                    189: ifeq ($(CPU), ppc)
                    190: #      set the compiler and compiler flags
                    191:        CC              =       mwcc
                    192:        CFLAGS  +=
                    193:
                    194: #      SETTING: set the proper optimization level
                    195:        ifeq ($(OPTIMIZE), FULL)
                    196:                OPTIMIZER       = -O7
                    197:        else
                    198:        ifeq ($(OPTIMIZE), SOME)
                    199:                OPTIMIZER       = -O3
                    200:        else
                    201:        ifeq ($(OPTIMIZE), NONE)
                    202:                OPTIMIZER       =
                    203:        else
                    204: #              OPTIMIZE not set so set to full
                    205:                OPTIMIZER       = -O7
                    206:        endif
                    207:        endif
                    208:        endif
                    209:
                    210:
                    211:        CFLAGS += $(OPTIMIZER)
                    212:
                    213: #      SETTING: set warning level
                    214:        ifeq ($(WARNINGS), ALL)
                    215:                CFLAGS += -w all
                    216:        else
                    217:        ifeq ($(WARNINGS), NONE)
                    218:                CFLAGS += -w 0
                    219:        endif
                    220:        endif
                    221:
                    222:        # clear the standard environment variable
                    223:        # now there are no standard libraries to link against
                    224:        BELIBFILES=
                    225:
                    226: #      set the linker and linker flags
                    227:        LD                      = mwldppc
                    228:
                    229: #      SETTING: set linker flags for each binary type
                    230:        ifeq ($(TYPE), APP)
                    231:                LDFLAGS +=
                    232:        else
                    233:        ifeq ($(TYPE), SHARED)
                    234:                LDFLAGS +=      -xms
                    235:        endif
                    236:        endif
                    237:
                    238:        ifeq ($(TYPE), DRIVER)
                    239:                LDFLAGS += -nodefaults \
                    240:                                        -export all \
                    241:                                        -G \
                    242:                                        /boot/develop/lib/ppc/glue-noinit.a \
                    243:                                        /boot/develop/lib/ppc/_KERNEL_
                    244:        else
                    245:                LDFLAGS +=      -export pragma \
                    246:                                        -init _init_routine_ \
                    247:                                        -term _term_routine_ \
                    248:                                        -lroot \
                    249:                                        /boot/develop/lib/ppc/glue-noinit.a \
                    250:                                        /boot/develop/lib/ppc/init_term_dyn.o \
                    251:                                        /boot/develop/lib/ppc/start_dyn.o
                    252:        endif
                    253:
                    254:
                    255: #      SETTING: output symbols in an xMAP file
                    256:        ifeq ($(SYMBOLS), TRUE)
                    257:                LDFLAGS += -map $(TARGET).xMAP
                    258:        endif
                    259:
                    260: #      SETTING: output debugging info to a .SYM file
                    261:        ifeq ($(DEBUGGER), TRUE)
                    262:                LDFLAGS += -g -osym $(TARGET).SYM
                    263:        endif
                    264:
                    265: endif
                    266: endif
                    267:
                    268:
                    269: # psuedo-function for converting a list of source files in SOURCES variable
                    270: # to a corresponding list of object files in $(OBJ_DIR)/xxx.o
                    271: # The "function" strips off the src file suffix (.ccp or .c or whatever)
                    272: # and then strips of the directory name, leaving just the root file name.
                    273: # It then appends the .o suffix and prepends the $(OBJ_DIR)/ path
                    274: define SRCS_LIST_TO_OBJS
                    275:        $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
                    276:        $(basename $(notdir $(file))))))
                    277: endef
                    278:
                    279: OBJS = $(SRCS_LIST_TO_OBJS)
                    280:
                    281: # create a unique list of paths to our sourcefiles
                    282: SRC_PATHS += $(sort $(foreach file, $(SOURCES), $(dir $(file))))
                    283:
                    284: # add source paths to VPATH if not already present
                    285: VPATH :=
                    286: VPATH += $(addprefix :, $(subst  ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
                    287:
                    288: # add source paths and include paths to INLCUDES if not already present
                    289: INCLUDES = $(foreach path, $(INCPATHS) $(SRC_PATHS), $(addprefix -I, $(path)))
                    290:
                    291:
                    292: # SETTING: add the -L prefix to all library paths to search
                    293: LINK_PATHS = $(foreach path, $(LIBPATHS) $(SRC_PATHS) , \
                    294:        $(addprefix -L, $(path)))
                    295:
                    296: # SETTING: add the -l prefix to all libs to be linked against
                    297: LINK_LIBS = $(foreach lib, $(LIBS), $(addprefix -l, $(lib)))
                    298:
                    299: # add to the linker flags
                    300: LDFLAGS += $(LINK_PATHS) $(LINK_LIBS)
                    301:
                    302: #      SETTING: add the defines to the compiler flags
                    303: CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
                    304:
                    305: #      SETTING: use the archive tools if building a static library
                    306: #      otherwise use the linker
                    307: ifeq ($(TYPE), STATIC)
                    308:        BUILD_LINE = ar -cru $(TARGET) $(OBJS)
                    309: else
                    310:        BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS)
                    311: endif
                    312:
                    313: #      create the resource instruction
                    314:        ifeq ($(RSRCS), )
                    315:                DO_RSRCS :=
                    316:        else
                    317:                DO_RSRCS := $(XRES) -o $(TARGET) $(RSRCS)
                    318:        endif
                    319:
                    320:
                    321: #      define the actual work to be done
                    322: default: $(TARGET)
                    323:
                    324: $(TARGET):     $(OBJ_DIR) $(OBJS) $(RSRCS)
                    325:                $(BUILD_LINE)
                    326:                $(DO_RSRCS)
                    327:                $(MIMESET) -f $@
                    328:
                    329:
                    330: #      rule to create the object file directory if needed
                    331: $(OBJ_DIR)::
                    332:        @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
                    333:
                    334: $(OBJ_DIR)/%.o : %.c
                    335:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    336: $(OBJ_DIR)/%.o : %.cpp
                    337:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    338: $(OBJ_DIR)/%.o : %.cp
                    339:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    340: $(OBJ_DIR)/%.o : %.C
                    341:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    342: $(OBJ_DIR)/%.o : %.CC
                    343:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    344: $(OBJ_DIR)/%.o : %.CPP
                    345:        $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
                    346:
                    347:
                    348: #      empty rule. Things that depend on this rule will always get triggered
                    349: FORCE:
                    350:
                    351: #      The generic clean command. Delete everything in the object folder.
                    352: clean :: FORCE
                    353:        -rm -rf $(OBJ_DIR)
                    354:
                    355: #
                    356: distclean: clean
                    357:
                    358: #      remove just the application from the object folder
                    359: rmapp ::
                    360:        -rm -f $(TARGET)
                    361:
                    362: # generic distdir rules - needed with automake
                    363: # maybe we can automakify the Makefile?
                    364: srcdir = .
                    365: top_builddir = ../..
                    366:
                    367: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/src/$(subdir)
                    368:
                    369: subdir = beos
                    370:
                    371: DISTFILES = $(SOURCES) $(HEADERS) $(EXTRA_DIST)
                    372:
                    373: distdir: $(DISTFILES)
                    374:        distdir=`cd $(distdir) && pwd`
                    375:        @for file in $(DISTFILES); do \
                    376:          d=$(srcdir); \
                    377:          if test -d $$d/$$file; then \
                    378:            cp -pr $$d/$$file $(distdir)/$$file; \
                    379:          else \
                    380:            test -f $(distdir)/$$file \
                    381:            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
                    382:            || cp -p $$d/$$file $(distdir)/$$file || :; \
                    383:          fi; \
                    384:        done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>