0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

単一ソースファールの複数プログラムを一括でビルドするMakefile

Posted at

競プロや検証時みたいな「たくさん1ソースファイルのC++コードを同じディレクトリで書いてバイナリ吐きたい」時用のMakefile。

SOURCE := $(wildcard *.cpp)
OBJECT := $(SOURCE:%.cpp=%.o)
BINARY := $(SOURCE:%.cpp=%)
CXXFLAGS := -Wall
#LDLIBS := -lm
.PHONY: all clean
all: $(BINARY)
clean:
    $(RM) $(OBJECT) $(BINARY)

ライブラリが必要ならLDLIBSを記述、makeでC++コードを同一名のバイナリにビルド、make cleanでバイナリ削除。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?