トップ  eラーニング  書籍紹介  用語集

Google

言語

開発環境

Webアプリ/ミドル

データベース

OS/ネットワーク

ITスキル

海外サイト翻訳

書籍検索

用語検索

Borland C++ Compiler makefile作成

makefile


//hello.h

#ifndef HELLO_H
#define HELLO_H

int hello();

#endif

//main.cpp

#include "hello.h"

int main()
{
  hello();
  return 0;
}


//hello.cpp

#include <iostream>
using namespace std;

int hello()
{
  cout << "Hello World !!" << endl;
  return 0;
}

# makefile.mak

CC      = bcc32
LINKER  = ilink32

INCLUDE = -I"C:\borland\bcc55\Include"
LIB     = -L"C:\borland\bcc55\Lib"

#コンソールアプリケーションのためのコンパイルオプション
CFLAGS = -O2 -w -tWC
LFLAGS = /Tpe

TARGET = hello.exe
OBJS   = hello.obj \
         main.obj

ALL : $(TARGET)

# -- objファイルの作成
hello.obj main.obj: hello.cpp main.cpp
 $(CC) $(CFLAGS) -c hello.cpp main.cpp

# -- exeファイルの作成
$(TARGET): $(OBJS)
 $(LINKER) $(LFLAGS) $(LIB) $(OBJS) \
           c0x32.obj,$(TARGET),,cw32.lib import32.lib

clean:
 del *.obj
 del *.tds
 del *.il*
 del *.map

コンパイル&リンク
make -f Makefile.mak

クリーン
make -f Makefile.mak clean

戻る

Loarding…

グループサイト  zealseeds  zealseedsラーニング  zealseedsブックス  名か字  名科辞典  幸福の木の育て方

Copyright (C) 2007-2011 zealseeds. All Rights Reserved.お問合せ