Giter VIP home page Giter VIP logo

makefile-templates's Introduction

Zixuan Wang

Hi, I'm Zixuan Wang, a PhD candidate at UCSD, doing research on memory systems.

I maintain a few open-source projects, see below for more details.

I take photos, check my photo blog.

More info on my website.

makefile-templates's People

Contributors

apwiggins avatar mauro-balades avatar parthvshah avatar rodrigo103 avatar sirh3e avatar thenetadmin avatar vpoulailleau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

makefile-templates's Issues

Small Project Template is not recompilling obj files

I was using this Small Template to play with a dummy project I created to learn a bit about git.
However, after making some branches, some changes and committing and pushing them up to my github repository, I tried to recompile the project but it failed due to some multiple definition of a function. I had to 'make clean' and 'make' again to be able to compile the project with updated object files.
It should rather detect that the obj files were outdated and relink them all again.

`-s` option causes error

Issue

-s option in MAKEFLAGS causes compilation failure.

Building Project
make[1]: *** No rule to make target 's'.  Stop.
/home/ubuntu/Makefile-Templates/MediumProject/Example/config/make.global:18: recipe for target 'src1' failed
make: *** [src1] Error 2

Environment

  • GNU Make 4.1. It supports the -s option.
  • ubuntu 4.15.0-54-generic

The MediumExample can be compiled successfully after removing the -s option.

Makefile Small Project - MAIN_SRC not being used make compilation to fail

Hi.

In line 20, we are requested to enter the file that contains function 'main.c'. The docs says to place main.c in root directory (I assume not inside src/).

MAIN_SRC :=# FILL: src file contains main()``

This macro is not being used when object files are created, so main.o is never created, making the compilation to fail.

Workaround is to place main.c inside src/ and add it to Makefile like so:
MAIN_SRC :=src/main.c

Link shared libs using Small Project Template

Some compilation error occurs when linking libxml2.
Moving CCFLAGS to the end solves the problem, but I'm not sure why.

CCFLAGS is set to

CCFLAGS := -I/usr/include/libxml2 -lxml2

Solution

diff --git a/Makefile b/Makefile
index 94d8e0505876947c8f6786343cd178b4ef846035..390ae65500b699557b3da12391e05e75ae94b2e7 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ default: makedir all
 
 # non-phony targets
 $(TARGET): $(OBJ)
-	$(CC) $(CCFLAGS) -o $@ $(OBJ)
+	$(CC) -o $@ $(OBJ) $(CCFLAGS)
 
 $(OBJ_PATH)/%.o: $(SRC_PATH)/%.c*
 	$(CC) $(CCOBJFLAGS) -o $@ $<

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.