本文共 2256 字,大约阅读时间需要 7 分钟。
Makefile:
## Makefile for the "hello" open source library and application#VERSION=1.0CC=gccCFLAGS=-O2.PHONY: libhello allall: hellohello: libhello.so.1 hello.o $(CC) $(CFLAGS) hello.o -L. -lhello -o hellohello.o: libhello.hlibhello: libhello.so.1libhello.so.1: libhello.o $(CC) -shared -Wl,-soname,libhello.so.1 libhello.o -lc -o libhello.so.1.0 ln -sf libhello.so.1.0 libhello.so.1 ln -sf libhello.so.1 libhello.solibhello.o: libhello.h $(CC) $(CFLAGS) -fPIC -c libhello.cclean: rm -f *.o *.so* hello hello*.tar.gztar: clean cd ..; tar czvf hello-$(VERSION).tar.gz --exclude .svn hello-$(VERSION)install: all install libhello.so.1.0 /usr/local/lib ln -sf libhello.so.1.0 /usr/local/lib/libhello.so.1 ln -sf libhello.so.1 /usr/local/lib/libhello.so install hello /usr/local/bin install hello.1 /usr/local/share/man/man1# install hello.conf /etc/ld.so.conf.d /sbin/ldconfiguninstall: rm -f /usr/local/lib/libhello.so* rm -f /usr/local/bin/hello rm -f /usr/local/share/man/man1/hello.1# rm -f /etc/ld.so.conf.d/hello.conf /sbin/ldconfighello.spec
Summary: Hello motivational softwareName: helloVersion: 1.0Release: 1License: Freely redistributable without restrictionGroup: Applications/ProductivitySource0: %{name}-%{version}.tar.gzBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%descriptionhello is a soft skills enhancement applicationused by well-managed organizations worldwide.%prep%setup -q%buildmake%installrm -rf $RPM_BUILD_ROOTmkdir -p $RPM_BUILD_ROOT/usr/local/{bin,lib,share/man/man1}mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.dinstall libhello.so.1.0 $RPM_BUILD_ROOT/usr/local/libinstall hello $RPM_BUILD_ROOT/usr/local/bingzip -9c hello.1 > hello.1.gzinstall hello.1.gz $RPM_BUILD_ROOT/usr/local/share/man/man1install hello.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d%cleanmake cleanrm -rf $RPM_BUILD_ROOT%files%defattr(-,root,root,-)%config(noreplace) /etc/ld.so.conf.d/hello.conf/usr/local/bin/hello/usr/local/lib/libhello.so.1.0%doc /usr/local/share/man/man1/hello.1.gz%doc README%postln -sf libhello.so.1.0 /usr/local/lib/libhello.so.1ln -sf libhello.so.1 /usr/local/lib/libhello.so/sbin/ldconfig%changelog* Wed Jan 27 2010 Charles Channelman本文相关资源下载:- 1.0-1- Initial build.
http://download.csdn.net/detail/t0nsha/4559332
转载地址:http://qjtai.baihongyu.com/