国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Makefile

2023-03-02 22:08 作者:小粉絲8  | 我要投稿

// Makefile

SUBDIRS = main foo

all : $(SUBDIRS)

install : $(SUBDIRS)

# $(call version_number,1.2.3) # major.minor.patch

# libtool manual chapter 4.2: -version-number

define version_number

? $(MAKE) -C $@ soname=lib$@.so.$(word 1,$(subst ., ,$(1)))

? @ cp $@/$@ $@/lib$@.so.$(1)

? @ cd $@; ln -f -s lib$@.so.$(1) lib$@.so.$(word 1,$(subst ., ,$(1))); cd ..

? @ cd $@; ln -f -s lib$@.so.$(1) lib$@.so; cd ..

endef

main : foo

main :

? $(MAKE) -C $@

foo :

? $(call version_number,5.2.3)

# make DESTDIR=~/foo install

install :

? install -d "$(DESTDIR)/usr/local/bin"

? install -d "$(DESTDIR)/usr/local/lib"

? install -m 0755 main/main "$(DESTDIR)/usr/local/bin"

? install -m 0755 foo/*.so* "$(DESTDIR)/usr/local/lib"

clean :

? @ for dir in $(SUBDIRS); do \

? ? $(MAKE) -C $$dir $@; \

? done

.PHONY : $(SUBDIRS) all install clean


---


// main/Makefile

# build shared library with -fPIC, -shared

CFLAGS ? = # -g -O3 -fPIC # CXXFLAGS for .cpp

CPPFLAGS = -MMD -MP -I../foo

LDFLAGS ?= -L../foo -Wl,-rpath,'$$ORIGIN/../foo' # -shared

LDLIBS ? = -lfoo

#CC ? ? ?= $(CXX) # link with CXX for .cpp

LDFLAGS += -Wl,-rpath,'$$ORIGIN/../lib'

#LDFLAGS += -Wl,-soname,$(soname)

# make # NDEBUG=1

ifdef NDEBUG

CPPFLAGS += -DNDEBUG

CFLAGS += -O3 # .cpp

else

CFLAGS += -g # .cpp

LDFLAGS += -fsanitize=address

endif

all : main # foo

# target name is basename of one of the source files

main : $(patsubst %.c,%.o,$(wildcard *.c)) # .cpp

#foo : $(patsubst %.c,%.o,foo.c) # .cpp

-include *.d

clean : ; -rm -fr *.o *.d main

.PHONY : all clean


---


// foo/Makefile

# build shared library with -fPIC, -shared

CFLAGS ? = -fPIC # -g -O3 # CXXFLAGS for .cpp

CPPFLAGS = -MMD -MP # -I../bar

LDFLAGS ?= -shared # -L../bar -Wl,-rpath,'$$ORIGIN/../bar'

LDLIBS ? = #-lbar

#CC ? ? ?= $(CXX) # link with CXX for .cpp

LDFLAGS += -Wl,-rpath,'$$ORIGIN/../lib'

LDFLAGS += -Wl,-soname,$(soname)

# make # NDEBUG=1

ifdef NDEBUG

CPPFLAGS += -DNDEBUG

CFLAGS += -O3 # .cpp

else

CFLAGS += -g # .cpp

LDFLAGS += -fsanitize=address

endif

all : foo # bar

# target name is basename of one of the source files

foo : $(patsubst %.c,%.o,$(wildcard *.c)) # .cpp

#bar : $(patsubst %.c,%.o,bar.c) # .cpp

-include *.d

clean : ; -rm -fr *.o *.d foo *.so*

.PHONY : all clean


Makefile的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
祁门县| 阿合奇县| 土默特右旗| 治县。| 旺苍县| 昆明市| 新兴县| 泰安市| 乌拉特中旗| 垣曲县| 巴马| 雷波县| 平原县| 永济市| 周至县| 红河县| 濮阳市| 和顺县| 青海省| 德令哈市| 孟州市| 信宜市| 吕梁市| 金阳县| 闵行区| 普格县| 盐津县| 抚顺市| 文昌市| 莫力| 伊春市| 四川省| 晋中市| 普陀区| 江源县| 衡东县| 大厂| 锡林浩特市| 改则县| 平山县| 阿城市|