Last active
August 29, 2015 13:55
-
-
Save doi-t/8690106 to your computer and use it in GitHub Desktop.
makeでライブラリ(.a)のビルドを管理するサンプル(g++.ver)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "hello.h" | |
int | |
print_hello(void) | |
{ | |
printf("hello gnu ar world !!\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ___hello | |
#define ___hello | |
#include <stdio.h> | |
int print_hello(void); | |
#endif //___hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RM := rm -f | |
CXXFLAGS := -Wall | |
programs := run | |
.PHONY: all | |
all: $(programs) | |
$(programs): libhello.a | |
libhello.a: libhello.a(hello.o) | |
hello.o: hello.h | |
.PHONY: clean | |
clean: | |
$(RM) *.o *.a $(programs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "hello.h" | |
int | |
main(int argc, char **argv) | |
{ | |
print_hello(); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment