##################################################################### # # Name: Makefile # Created by: Stefan Ritt # # Contents: Makefile for MIDAS example frontend and analyzer # # $Id$ # ##################################################################### # #-------------------------------------------------------------------- # The MIDASSYS should be defined prior the use of this Makefile ifndef MIDASSYS missmidas:: @echo "..."; @echo "Missing definition of environment variable 'MIDASSYS' !"; @echo "..."; endif # get OS type from shell OSTYPE = $(shell uname) #-------------------------------------------------------------------- # The following lines contain specific switches for different UNIX # systems. Find the one which matches your OS and outcomment the # lines below. #----------------------------------------- # This is for Linux ifeq ($(OSTYPE),Linux) OSTYPE = linux endif ifeq ($(OSTYPE),linux) OS_DIR = linux OSFLAGS = -DOS_LINUX -Dextname CFLAGS = -g -O2 -Wall # add to compile in 32-bit mode # OSFLAGS += -m32 LIBS = -lusb -lm -lz -lutil -lnsl -lpthread -lrt endif #----------------------- # MacOSX/Darwin is just a funny Linux # ifeq ($(OSTYPE),Darwin) OSTYPE = darwin endif ifeq ($(OSTYPE),darwin) OS_DIR = darwin FF = cc OSFLAGS = -DOS_LINUX -DOS_DARWIN -DAbsoftUNIXFortran -fPIC -Wno-unused-function LIBS = -lpthread -lz SPECIFIC_OS_PRG = $(BIN_DIR)/mlxspeaker NEED_STRLCPY= NEED_RANLIB=1 NEED_SHLIB= NEED_RPATH= endif #------------------------------------------------------------------- # The following lines define directories. Adjust if necessary # INC_DIR = $(MIDASSYS)/include LIB_DIR = $(MIDASSYS)/$(OS_DIR)/lib SRC_DIR = $(MIDASSYS)/src #------------------------------------------------------------------- # Frontend code name defaulted to frontend in this example. # comment out the line and run your own frontend as follow: # gmake UFE=my_frontend # UFE = feccusb #################################################################### # Lines below here should not be edited #################################################################### # MIDAS library LIB = $(LIB_DIR)/libmidas.a /usr/lib/libxx_usb.so # compiler CC = gcc CXX = g++ CFLAGS += -g -I$(INC_DIR) -I$(DRV_DIR) LDFLAGS += all: $(UFE) $(UFE): $(LIB) $(LIB_DIR)/mfe.o $(UFE).cxx $(CXX) $(CFLAGS) $(OSFLAGS) -o $(UFE) $(UFE).cxx $(LIB_DIR)/mfe.o $(LIB) $(LDFEFLAGS) $(LIBS) $(DRIVER).o: $(DRV_DIR)/$(DRIVER).c $(CC) $(CFLAGS) $(OSFLAGS) -c -o $(DRIVER).o $(DRV_DIR)/$(DRIVER).c analyzer: $(LIB) $(LIB_DIR)/rmana.o analyzer.o $(MODULES) $(CXX) $(CFLAGS) -o $@ $(LIB_DIR)/rmana.o analyzer.o $(MODULES) \ $(LIB) $(LDFLAGS) $(ROOTLIBS) $(LIBS) %.o: %.c experim.h $(CXX) $(USERFLAGS) $(ROOTCFLAGS) $(CFLAGS) $(OSFLAGS) -o $@ -c $< clean:: rm -f $(UFE) *.o *~ \#* #end file