目前分類:Software Engineering (41)
- Aug 09 Tue 2011 05:05
Create a git repository for Mac OS X kernel xnu
- Jul 06 Wed 2011 23:31
Generic Makefile for Objective-C/C++
Generic Makefile for Objective-C/C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# Generic Makefile for Objective-C/C++ prog_name = ###################################### # # Generic makefile for single-target. # # by Jackie Xie # email: jackie.CPlusPlus@gmail.com # # Copyright (c) 2008~2010 Jackie Xie # All rights reserved. # # No warranty, no liability; # you use this at your own risk. # # You are free to modify and # distribute this without giving # credit to the original author. # ###################################### ### Customising # # Adjust the following if necessary; EXECUTABLE is the target # executable's filename, and LIBS is a list of libraries to link in # (e.g. alleg, stdcx, iostr, etc). You can override these on make's # command line of course, if you prefer to do it that way. # EXECUTABLE := $(prog_name) LIBS := # Now alter any implicit rules' variables if you like, e.g.: # CFLAGS := -Wno-import -std=c99 CXXFLAGS := $(CFLAGS) CC := g++ LDFLAGS = -L/System/Library/Frameworks/Foundation.framework/ -lobjc -framework Foundation # The next bit checks to see whether rm is in your djgpp bin # directory; if not it uses del instead, but this can cause (harmless) # `File not found' error messages. If you are not using DOS at all, # set the variable to something which will unquestioningly remove # files. # ifneq ($(wildcard $(DJDIR)/bin/rm),) RM-F := rm -f else RM-F := del endif # You shouldn't need to change anything below this point. # # 從這裡開始,你應該不需要改動任何東西。 SOURCE := $(wildcard *.m) $(wildcard *.mm) $(wildcard *.c) $(wildcard *.cc) $(wildcard *.cxx) $(wildcard *.cpp) OBJS := $(patsubst %.cpp,%.o,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(patsubst %.m,%.o,$(patsubst %.mm,%.o,$(SOURCE)))))) DEPS := $(patsubst %.o,%.d,$(OBJS)) MISSING_DEPS := $(filter-out $(wildcard $(DEPS)),$(DEPS)) MISSING_DEPS_SOURCES := $(wildcard $(patsubst %.d,%.m,$(MISSING_DEPS)) $(patsubst %.d,%.mm,$(MISSING_DEPS))) CPPFLAGS += -MD .PHONY : everything deps objs clean veryclean rebuild everything : $(EXECUTABLE) deps : $(DEPS) objs : $(OBJS) clean : @$(RM-F) *.o @$(RM-F) *.d @$(RM-F) *.*~ *~ @$(RM-F) $(EXECUTABLE) @$(RM-F) $$(file `find .` | grep "bit executable" | awk '{print $$1}' | sed 's/\.*\://') veryclean: clean distclean: veryclean rebuild: veryclean everything ifneq ($(MISSING_DEPS),) $(MISSING_DEPS) : @$(RM-F) $(patsubst %.d,%.o,$@) endif -include $(DEPS) $(EXECUTABLE) : $(OBJS) $(CC) -o $(EXECUTABLE) $(LDFLAGS) $(OBJS) $(addprefix -l,$(LIBS)) # Delete all executable files recursively at curent directory. # filenames=file `find . ` | grep "bit executable" | awk '{print $1}' | sed 's/\.*\://' # for i in $filenames; do rm -f $i ; done; |
- Jul 05 Tue 2011 22:34
A Generic Makefile for building multi-targets on Linux/Mac OSX
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
####################################################### # # Generic makefile - Building Multi-targets. # To build all targets separately. # # by Jackie Xie # email: jackie.CPlusPlus@gmail.com # # Copyright (c) 2008 Jackie Xie # All rights reserved. # # No warranty, no liability; # you use this at your own risk. # # You are free to modify and # distribute this without giving # credit to the original author. # ####################################################### OS := $(shell uname -s) CC = gcc RM = rm MAKE = make SOURCE := $(wildcard *.c) $(wildcard *.cc) $(wildcard *.cxx) $(wildcard *.cpp) #TARGET=$(shell target=""; for i in $(SOURCE); do target+=$(echo $i | awk -F"." '{ printf $1}'); target+=" "; done;) CFLAGS = -fno-stack-protector -Wall all: @TARGET=""; for i in $(SOURCE); do TARGET+=$$(echo $$i | awk -F"." '{ printf $$1}'); TARGET+=" "; done; \ for i in $$TARGET; \ do \ #$(CC) -o "$$i" "$$i".c $(CFLAGS); \ $(MAKE) $$i; \ done; clean: ${RM} -f *.o *~ ifeq ($(strip $(OS)),Darwin) ${RM} -f $$(file `find .` | grep "bit executable" | awk '{print $$1}' | sed 's/\.*\://') else ifeq ($(strip $(OS)),Linux) ${RM} -f $$(file `find .` | grep "bit ...* executable" | awk '{print $$1}' | sed 's/\.*\://') endif |
- Jul 02 Sat 2011 19:45
Import configure.ac & Makefile.am to tropicssl
- Jan 05 Wed 2011 19:47
Installing Alternate GCC Compiler on Fedora
Installing Alternate GCC Compiler on Fedora
This guide shows how to installed an alternate GCC compiler from source using Fedora Core. By using these steps you should be able to configure and install any GCC compiler you might require. You can upgrade your GCC compiler or downgrade your GCC compiler if you require.
- Nov 13 Fri 2009 07:41
利用 autoscan/aclocal /autoconf/automake 來管理軟體專案
- Nov 13 Fri 2009 07:41
利用 Autotools 來管理軟體專案
- Oct 26 Mon 2009 19:32
在 CentOS/Debian 上安裝及架設 Git + Trac
Debian Linux 架設 Git + Trac
Trac + SVN 的搭配非常方便, 也是一直沒從 SVN 轉換到 Git 的原因之一.
既然想要取代 SVN, Trac + Git 當然也是該要有的, 下面就來將 Trac + Git 完成.
- Sep 23 Wed 2009 00:58
萬能的Makefile檔案
萬能的Makefile檔案
- Mar 09 Mon 2009 18:26
Tech Talk:Linus Torvalds on git
Tech Talk:Linus Torvalds on git
這是 Linus Torvalds 在 Google 所進行的一段演講,身為一個性格強硬的硬底子駭客,他時常發出驚人的評論,有些有趣的言論甚至被整理成格言集,像是 The 10 Best Linus Torvalds Quotes 或 Linus Torvalds Quotes。
- Jul 22 Tue 2008 23:34
Backup Trac/Tickets
- Apr 12 Thu 2007 02:17
利用命令稿(Shell Script)來為Makefile自動產生依存關係
- Oct 30 Mon 2006 17:59
【RSA authentication for CVS】
- Jun 07 Wed 2006 19:50
Practical CVS Tutorial
Practical CVS Tutorial
The purpose of this tutorial is to provide practical examples of how to use CVS during a typical source development cycle. The complexity of the CVS interface and underlying structure tends to prevent casual use of the system and prevents us from taking full advantage of the multi-user, parallel development features. With the examples provided in this tutorial, it will be possible to use CVS as just another tool, simplifying back porting bug fixes, maintainence of released packages, and safely going about large scale code changes (such as a platform port, architectural changes, or adding experimental code). Those using CVS after this tutorial will be able to enjoy some of its more mysterious benefits with as little trouble as possible.
- Jun 01 Thu 2006 22:17
How to write a Makefile
How to write a Makefile
Introduction
Make is one of the original Unix tools for Software Engineering. By S.I. Feldman of AT&T Bell Labs circa 1975. But there are public domain versions (eg. GNU) and versions for other systems (eg. Vax/VMS).
Related tools are the language compilers (cc, f77, lex, yacc, etc.) and shell programming tools (eg. awk, sed, cp, rm, etc.). You need to know how to use these.
- May 05 Fri 2006 21:37
CVS (Current Versions System)
- Apr 28 Fri 2006 21:47
ZHSVKTutorial (Revision 674)
ZHSVKTutorial (Revision 674)
30 秒入門
照著 InstallingSVK 的介紹安裝好 svk 之後,請在命令列模式(Windows 上現在叫作「命令提示字元」,而像是 FreeBSD、Mac OS X 或 Linux 之類的泛 UNIX,通常叫「終端機」)裡,進行下列步驟:
- Dec 24 Sat 2005 00:34
工廠模式和容器模式的探索