# # Warning: This makefile assumes that you are using Gnu Make. # # Change the value of the MX_ARCH variable below to match the platform you # are compiling mx_ad_copy for. The available platforms are: # # linux - Compile for Linux # win32 - Compile for Win32 using Visual C++ # # To build the MX area detector copy program, you must first build the MX # library itself. Next, set the variables MX_ARCH and LIBMXSRC below. # Then do a "make depend" and finally a "make". # MX_ARCH = linux MX_INSTALL_DIR = /opt/mx #MX_INSTALL_DIR = c:/opt/mx-2.0.0-2016_03_11 #----------------------------------------------------------------------- # The following trick with different levels of .. for LIBMXSRC and MAKEHEAD # is only necessary if you are using relative paths. If you are using # absolute paths, just set MAKEHEAD to $(LIBMXSRC)/Makehead.$(MX_ARCH). LIBMXSRC = ../mx/libMx MAKEHEAD = ../mx/libMx/Makehead.$(MX_ARCH) MX_INCLUDE = $(LIBMXSRC) ifeq ($(MX_ARCH),win32) MX_AD_COPY_NAME = mx_ad_copy.exe else MX_AD_COPY_NAME = mx_ad_copy endif all: $(MX_AD_COPY_NAME) include $(MAKEHEAD) -include Makefile.depend MX_AD_COPY_OBJS = mx_ad_copy.$(OBJ) #----------------------------------------------------------------------- # Linux ifeq ($(MX_ARCH),linux) COMPILE_FLAGS = -g -Wall -Werror -DOS_LINUX -DDEBUG $(GCC_FLAGS) -I$(MX_INCLUDE) COMPILE = gcc -c $(COMPILE_FLAGS) $(OPTIMIZE) LIBMX = ../mx/libMx/libMx.so $(MX_AD_COPY_NAME): $(MX_AD_COPY_OBJS) gcc -g -o $(MX_AD_COPY_NAME) $(MX_AD_COPY_OBJS) $(LIBMX) depend: -$(RM) Makefile.depend $(CC) -MM $(COMPILE_FLAGS) -D__MX_MAKEDEPEND__ *.c > Makefile.depend endif #----------------------------------------------------------------------- # Win32 ifeq ($(MX_ARCH),win32) COMPILE_FLAGS = -MD -Zi -WX -DOS_WIN32 -DDEBUG -I$(MX_INCLUDE) -nologo COMPILE = cl -c $(COMPILE_FLAGS) $(OPTIMIZE) LIBMX = ..\\\\mx\\\\libMx\\\\libMx.lib $(MX_AD_COPY_NAME): $(MX_AD_COPY_OBJS) link /debug /nologo /out:$(MX_AD_COPY_NAME) mx_ad_copy.obj \ /nodefaultlib:libc $(DEBUG_OPTS) \ $(LIBMX) $(WIN32_LIBS) # For VC2005 or later, embed the mainfest in the executable. if test -f $(MX_AD_COPY_NAME).manifest; then \ $(MSMANIFEST_TOOL) -nologo \ -outputresource:$(MX_AD_COPY_NAME)\;1 \ -manifest $(MX_AD_COPY_NAME).manifest ; \ rm -f $(MX_AD_COPY_NAME).manifest ; \ fi depend: -rm Makefile.depend makedepend -o.obj -Y -I../../mx/libMx -f- *.c* 2>/dev/null > Makefile.depend endif #----------------------------------------------------------------------- mx_ad_copy.$(OBJ): mx_ad_copy.c mx_ad_copy.h $(COMPILE) mx_ad_copy.c clean: -rm $(MX_AD_COPY_NAME) *.$(OBJ) *.exe *.exp *.ilk *.lib *.pdb *.sln *.suo core* distclean: clean -rm Makefile.depend install: cp $(MX_AD_COPY_NAME) $(MX_INSTALL_DIR)/sbin