Lazy Way of making a Simple C++ Project

---
date: Apr 17, 2017
tags:
- C++
- Makefile
language: English
---

Sometimes, when I try to do a lab project, I have to copy the makefile from each previous project to make my life easier and more lazy. However, I think I should be more lazy-so what I do is modified my Makefile a little bit, so that it can be easier, that I don’t really need to modify the code any more, I just need to copy makefile and build my project ;)

Here is the code for my makefile, it is actually pretty simple:

1
2
3
4
5
6
7
TARGET=$(shell basename $(PWD))
create:
g++ -g -o $(TARGET) *.cpp *.h

clean:
/bin/rm -f $(TARGET)
clear

Navigation


Creative Commons License

Unless specified, all the articles are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


It uses a self-hosted Open Web Analytics to get insights. Click here to optout.

The site is powered by Hexo. The source code of this website is here, so that you can see the spaghetti code behind my blog.


Main | Blog | Comic | Podcasts (Preparing) | RSS | Sitemap
2008 - 2022 | Patrick WU Jinming