#----------------------------------------------------------------------------- # Makefile for Final Cut #----------------------------------------------------------------------------- # This is where make install will install the library VERSION = "0.3.0" MAJOR := $(shell echo ${VERSION} | cut -d. -f1) LIBDIR = /usr/local/lib64 INCLUDEDIR = /usr/local/include/final INCLUDE_HEADERS = \ fapp.h \ fbuttongroup.h \ fbutton.h \ fcheckbox.h \ fswitch.h \ fdialog.h \ fevent.h \ ffiledialog.h \ final.h \ flabel.h \ flineedit.h \ flistbox.h \ fmenu.h \ fdialoglistmenu.h \ fmenubar.h \ fradiomenuitem.h \ fcheckmenuitem.h \ fmessagebox.h \ ftooltip.h \ fobject.h \ foptiattr.h \ foptimove.h \ fpoint.h \ fprogressbar.h \ fradiobutton.h \ frect.h \ fscrollbar.h \ fscrollview.h \ fstatusbar.h \ fstring.h \ ftermcap.h \ fterm.h \ fvterm.h \ ftextview.h \ ftogglebutton.h \ fwidget.h \ fwindow.h # compiler parameter CXX = clang++ CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions MAKEFILE = -f Makefile.clang LDFLAGS = $(TERMCAP) -lgpm INCLUDES = -I./ GPM = -D F_HAVE_LIBGPM VER = -D F_VERSION=$(VERSION) RM = rm -f LIB = libfinal.so OBJS = \ fstring.o \ fpoint.o \ frect.o \ fscrollbar.o \ fprogressbar.o \ flineedit.o \ fbutton.o \ fbuttongroup.o \ ftogglebutton.o \ fradiobutton.o \ fcheckbox.o \ fswitch.o \ flabel.o \ flistbox.o \ fmenu.o \ fdialoglistmenu.o \ fmenubar.o \ fmenuitem.o \ fradiomenuitem.o \ fcheckmenuitem.o \ fmenulist.o \ fdialog.o \ fscrollview.o \ fwindow.o \ fmessagebox.o \ ftooltip.o \ ffiledialog.o \ ftextview.o \ fstatusbar.o \ fterm.o \ fvterm.o \ fevent.o \ foptiattr.o \ foptimove.o \ fapp.o \ fwidget.o \ fobject.o TERMCAP := $(shell test -n "$$(ldd {/usr,}/lib64/libncursesw.so.5 2>/dev/null | grep libtinfo)" && echo "-ltinfo" || echo "-lncurses") ifdef DEBUG OPTIMIZE = -O0 -fsanitize=undefined else OPTIMIZE = -O2 endif .SUFFIXES: .cpp # $@ = name of the targets # $< = the first dependency .cpp.o: $(CXX) -c $(CCXFLAGS) $(INCLUDES) -fpic -o $@ $< all: dep $(OBJS) $(CXX) $(CCXFLAGS) $(INCLUDES) $(LDFLAGS) -shared -Wl,-soname,$(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJS) ln -s -f $(LIB).$(VERSION) libfinal.so.$(MAJOR) ln -s -f $(LIB).$(MAJOR) libfinal.so $(LIB): all debug: $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wpadded" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" install: $(LIB) mkdir -p $(LIBDIR) install -c $(LIB).$(VERSION) $(LIBDIR)/$(LIB).$(VERSION) ln -s -f $(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) ln -s -f $(LIB).$(MAJOR) $(LIBDIR)/libfinal.so ldconfig mkdir -p $(INCLUDEDIR) @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ install -m 644 $$h $(INCLUDEDIR)/$$h; \ done uninstall: $(INCLUDE_HEADERS) $(RM) $(LIBDIR)/$(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) $(LIBDIR)/libfinal.so @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ $(RM) $(INCLUDEDIR)/$$h; \ done rmdir $(INCLUDEDIR) .PHONY: clean dep clean: $(RM) $(LIB)* $(OBJS) .depend *.gch *.plist *~ dep: $(CXX) $(INCLUDES) -MM *.cpp >.depend # # include .depend if it exists # -include .depend