Skip to content

Instantly share code, notes, and snippets.

@doi-t
Created January 20, 2014 16:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save doi-t/8523429 to your computer and use it in GitHub Desktop.
makeでライブラリ(.a)のビルドを管理するサンプル(gcc.ver)
#include "hello.h"
int
print_hello(void)
{
printf("hello gnu ar world !!\n");
return 0;
}
#include <stdio.h>
CC := gcc
RM := rm -f
CFLAGS = -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)
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