📄 makefile.linux
字号:
# Makefile for libmbus under FreeBSD# Copyright (C) 2003 Victor Antonovich# For conditions of distribution and use, see copyright notice in mbus.hLIBNAME = libmbusMBUSMAJ = 0MBUSMIN = 1.1MBUSVER = $(MBUSMAJ).$(MBUSMIN)CC=gccLDCONFIG=/sbin/ldconfig# where "make install" puts libmbus.a, libmbus.so*,# libmbus/mbus.h and libmbus/mbus_conf.h# Prefix must be a full pathname.prefix=/usr/localALIGN=# for i386:#ALIGN=-malign-loops=2 -malign-functions=2WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ -Wmissing-declarations -Wtraditional -Wcast-align \ -Wstrict-prototypes -Wmissing-prototypes #-WconversionCFLAGS+= -O2 -W -Wall -pedantic -I. -DDEBUG -DLIBMBUSLDFLAGS= -L. -lmbusLDFLAGS_A= -L. -static -lmbusRANLIB=ranlib#RANLIB=echoINCPATH=$(prefix)/includeLIBPATH=$(prefix)/libMANPATH=$(prefix)/manBINPATH=$(prefix)/bin# override DESTDIR= on the make install command line to easily support# installing into a temporary location. Example:## make install DESTDIR=/tmp/build/libmbus## If you're going to install into a temporary location# via DESTDIR, $(DESTDIR)$(prefix) must already exist before# you execute make install.DESTDIR=DB=$(DESTDIR)$(BINPATH)DI=$(DESTDIR)$(INCPATH)DL=$(DESTDIR)$(LIBPATH)DM=$(DESTDIR)$(MANPATH)OBJS = mbus.o mbus_cmd.o mbus_rqst.o mbus_sock.oOBJSDLL = $(OBJS:.o=.pic.o).SUFFIXES: .c .o .pic.o.c.pic.o: $(CC) -c $(CFLAGS) -fPIC -o $@ $*.call: libmbus.a $(LIBNAME).so mbus_test mbus_test.static libmbus.pclibmbus.pc: cat scripts/libmbus.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libmbus.pclibmbus.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@libmbus-config: ( cat scripts/libmbus-config-head.in; \ echo prefix=\"$(prefix)\"; \ echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ echo L_opts=\"-L$(LIBPATH)\"; \ echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ echo libs=\"-lmbus \"; \ cat scripts/libmbus-config-body.in ) > libmbus-config chmod +x libmbus-config$(LIBNAME).so: $(LIBNAME).so.$(MBUSMAJ) ln -sf $(LIBNAME).so.$(MBUSMAJ) $(LIBNAME).so$(LIBNAME).so.$(MBUSMAJ): $(LIBNAME).so.$(MBUSVER) ln -sf $(LIBNAME).so.$(MBUSVER) $(LIBNAME).so.$(MBUSMAJ)$(LIBNAME).so.$(MBUSVER): $(OBJSDLL) $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(MBUSMAJ) \ -o $(LIBNAME).so.$(MBUSVER) \ $(OBJSDLL)libmbus.so.1.$(MBUSMIN): $(OBJSDLL) $(CC) -shared -Wl,-soname,libmbus.so.1 \ -o libmbus.so.1.$(MBUSMIN) \ $(OBJSDLL)mbus_test: mbus_test.o $(LIBNAME).so $(CC) -o mbus_test $(CFLAGS) mbus_test.o $(LDFLAGS)mbus_test.static: mbus_test.o libmbus.a $(CC) -o mbus_test.static $(CFLAGS) mbus_test.o $(LDFLAGS_A)test: mbus_test mbus_test.static @echo "" @echo " Running mbus_test dynamically linked with $(LIBNAME).so:" @echo "" ./mbus_test @echo "" @echo " Running mbus_test statically linked with $(LIBNAME).a:" @echo "" ./mbus_test.staticinstall-headers: mbus.h mbus_conf.h -@if [ ! -d $(DI) ]; then mkdir $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi cp mbus.h mbus_conf.h $(DI)/$(LIBNAME) chmod 644 $(DI)/$(LIBNAME)/mbus.h $(DI)/$(LIBNAME)/mbus_conf.h -@/bin/rm -f $(DI)/mbus.h $(DI)/mbus_conf.h (cd $(DI); ln -sf $(LIBNAME)/* .)install-static: install-headers libmbus.a -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/libmbus.a cp libmbus.a $(DL)/$(LIBNAME).a chmod 644 $(DL)/$(LIBNAME).ainstall-shared: install-headers $(LIBNAME).so.$(MBUSVER) libmbus.pc -@if [ ! -d $(DL) ]; then mkdir $(DL); fi -@/bin/rm -f $(DL)/$(LIBNAME).so.$(MBUSVER)* $(DL)/$(LIBNAME).so -@/bin/rm -f $(DL)/libmbus.so cp $(LIBNAME).so.$(MBUSVER) $(DL) chmod 755 $(DL)/$(LIBNAME).so.$(MBUSVER) $(LDCONFIG) $(DL) (cd $(DL); \ ln -sf $(LIBNAME).so.$(MBUSVER) $(LIBNAME).so.$(MBUSMAJ); \ ln -sf $(LIBNAME).so.$(MBUSMAJ) $(LIBNAME).so) -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc cp libmbus.pc $(DL)/pkgconfig/$(LIBNAME).pc chmod 644 $(DL)/pkgconfig/$(LIBNAME).pcinstall-man: libmbus.3 libmbus_cmd.3 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi -@/bin/rm -f $(DM)/man3/libmbus.3 -@/bin/rm -f $(DM)/man3/libmbus_cmd.3 cp libmbus.3 $(DM)/man3 cp libmbus_cmd.3 $(DM)/man3install-config: libmbus-config -@if [ ! -d $(DB) ]; then mkdir $(DB); fi -@/bin/rm -f $(DB)/libmbus-config -@/bin/rm -f $(DB)/$(LIBNAME)-config cp libmbus-config $(DB)/$(LIBNAME)-config chmod 755 $(DB)/$(LIBNAME)-configinstall: install-static install-shared install-config install-man# If you installed in $(DESTDIR), test-installed won't work until you# move the library to its final location.clean: /bin/rm -f *.o libmbus.a mbus_test libmbus-config \ $(LIBNAME).so $(LIBNAME).so.$(MBUSMAJ)* mbus_test.static \ libmbus.so.1.$(MBUSMIN) \ libmbus.pcDOCS = AUTHORS COPYING ChangeLog NEWS README TODOwritelock: chmod a-w *.[ch35] $(DOCS) scripts/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -