# File : F1makefile.mk # Author : Dr. Clue ( A.K.A. Ian A. Storms ) # Copyright : @1995,96,97,98,99,00,01,02,03,04,05,... # Dr. Clue ( A.K.A. Ian A. Storms ) # # Description : Base makefile for all [ F1*_c ] directories. # Provides a central location for configuring platform specific # features and file location information. # Other make files use the include directive to include this # makefile. You must define these three variables # to let F1makefile.mk know where and what you want made. # # [CONFIGURATION EXECUTABLE ] # OUTPATH - Directory where you want the resulting executable to be placed. # OUTNAME - Name of executable less the file extension. # OUTEXT - Extension for executable ( .cgi, .exe ) # # [INCLUDING F1makefile.mk ] # include somepath/makelines/F1makefile.mk # # Urls : Documentation on creating Makefiles # http://computing.ee.ethz.ch/sepp/make-3.80-mo/ # For me , these are the on-line and off-line versions #OUTHOSTNAME="127.0.0.1" ifeq ($(shell hostname),dimarco) OUTHOSTNAME="www.drclue.net" endif ifeq ($(shell hostname),OTH1.secureserver.net) OUTHOSTNAME="www.mothergrid.com" endif #else # OUTHOSTNAME="127.0.0.1" #endif # Simply the combined output name OUTSTRING=$(OUTPATH)$(OUTNAME)$(OUTEXT) # Typically an application being created resides in a directory # parallel to that of the source code contained in this # library. If this is not the case simply over-ride this # value in your Makefile to indicate the directory path # to all the directory containing all the (F1*_c) named # sub directories SRCDIR=../ # # MYSQL includes directory # MYSQL_INCLUDES=/usr/include/mysql # Define Include directories. This makefile assumes that the directory # named by $(SRCDIR) contains the F1All_c directory that contains some # primary include files shared by all F1 code modules like F1types.h INCLUDES = -I$(SRCDIR)F1All_c -I$(MYSQL_INCLUDES) # Typically I've been using a shared subdirectory named OBJ for # each application, but here too , you can override the value in your # Makefile OBJDIR = $(SRCDIR)OBJ/ # This creates a unique #define based on the target, so that # target can contain test harness code with a main() or such # and use a #ifdef to toggle inclusion of that harness code # based upon the target. # DEFINES = -D$(OUTNAME)_MAIN -DDOMAIN_SERVER=\"$(OUTHOSTNAME)\" -DMEDIA_SERVER=\"$(OUTHOSTNAME)\" # LIBS [ Define Support Libraries used.] # The libraries that need to be included tend to vary # depending upon the specific OS involved, but # these are some common ones that I may or may # not have to use. # # LIBS=-ldl -lnsl -lsocket -lg++ -ldl -lsupc++ # # If the linker complains that something is undefined # it may mean that you need to specifiy more -l library # references. # # If the linker complains about multiple definitions # then one may have to remove -l library references. # # Once anything builds on a particular platform , it # most likely should not change, so if any of the F1 # makefiles run than this should probably not # be adjusted. LIBS=-lstdc++ -ldl # GCC [ Definition for C++ Compiler # Different platforms can and do have differing compilers # or aliases for same, such as GCC=gcc GCC=g++ GCC=g++ GCCSHARE=gcc # CCFLAGS [ Define Compiler options ] # -ggdb -nostdinc++ # -O -O3 -ggdb # -pedantic ( complain about everything ) # -g Add to CCFLAGS for maximal debugging info in 'G'db debugger. CCFLAGS= -c -ggdb -g # COMPILE [ The compile command used ] # This generally does not itself need tweaking # but rather is tweaked by the variables # mentioned in the line below. COMPILE=$(GCC) $(INCLUDES) $(CCFLAGS) $(DEFINES) # LINK [ Define Link command ] LINK=$(GCC) # Define SHARE Compiler Command -fPIC COMPILESHARE=$(GCCSHARE) $(INCLUDES) $(CCFLAGS) $(DEFINES) # Simply a text element for information output of progress messages define TXTbar echo "====================================" endef # Sorta a forward declaration as the real "all:" is further down below all: TXT_CLN :;@$(TXTbar);echo = CLEAN Make of $(OUTSTRING);$(TXTbar); TXT_INC :;@$(TXTbar);echo = INCREMENTAL Make of $(OUTSTRING);$(TXTbar); TXT_END :;@$(TXTbar);echo = Make Complete! $(OUTNAME) now @echo = available at $(OUTSTRING);$(TXTbar) TXT_BLD :$(OUTSTRING) Makefile TXT_DEL : @$(TXTbar);echo "= Removing $(OBJDIR)*.o for clean Make";$(TXTbar) @rm -f $(OBJDIR)*.o;rm -f *.so include $(SRCDIR)makelines/F1Out.mk # Main commands for make all : TXT_INC TXT_BLD TXT_END clean : TXT_CLN TXT_DEL TXT_BLD TXT_END