目前分類:Software Engineering (41)

瀏覽方式: 標題列表 簡短摘要

Create a git repository for Mac OS X kernel xnu

  

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

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;
文章標籤

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

 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

 

文章標籤

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Import configure.ac & Makefile.am to tropicssl

 

文章標籤

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

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.


Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Autotools: a practitioner's guide to Autoconf, Automake and Libtool

 

文章標籤

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Autotools: a practitioner's guide to Autoconf, Automake and Libtool

 

文章標籤

Bluelove1968 發表在 痞客邦 留言(2) 人氣()

Debian Linux 架設 Git + Trac

Trac + SVN 的搭配非常方便, 也是一直沒從 SVN 轉換到 Git 的原因之一.

既然想要取代 SVN, Trac + Git 當然也是該要有的, 下面就來將 Trac + Git 完成.

Bluelove1968 發表在 痞客邦 留言(5) 人氣()

萬能的Makefile檔案

文章標籤

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Tech Talk:Linus Torvalds on git

這是 Linus Torvalds 在 Google 所進行的一段演講,身為一個性格強硬的硬底子駭客,他時常發出驚人的評論,有些有趣的言論甚至被整理成格言集,像是 The 10 Best Linus Torvalds QuotesLinus Torvalds Quotes

Bluelove1968 發表在 痞客邦 留言(3) 人氣()

Ticket Backup in manual

<<< backup steps >>>

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

利用命令稿(Shell Script)來為Makefile自動產生依存關係

描述檔案(Description File)

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

How to use CVS without typing password each time?

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

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.

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

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.

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Makefile

Bluelove1968 發表在 痞客邦 留言(4) 人氣()

CVS (Current Versions System)




Bluelove1968 發表在 痞客邦 留言(0) 人氣()

ZHSVKTutorial (Revision 674)


30 秒入門

照著 InstallingSVK 的介紹安裝好 svk 之後,請在命令列模式(Windows 上現在叫作「命令提示字元」,而像是 FreeBSD、Mac OS X 或 Linux 之類的泛 UNIX,通常叫「終端機」)裡,進行下列步驟:

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

設計模式的點滴


設計模式使人們可以更加簡單方便地復用成功的設計和體系結構。將已證實的技術表述成設計模式也會使新系統開發者更加容易理解其設計思路。

Bluelove1968 發表在 痞客邦 留言(0) 人氣()

1 23