makefile update
This commit is contained in:
parent
f477e61091
commit
e4c3d1f330
|
|
@ -0,0 +1,6 @@
|
|||
#include "arithmetic.h"
|
||||
int add(int a, int b)
|
||||
{
|
||||
int c = a+b;
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
int add(int, int);
|
||||
Binary file not shown.
|
|
@ -0,0 +1,9 @@
|
|||
#include <iostream>
|
||||
#include "arithmetic.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout<<"Hello world!"<<std::endl;
|
||||
std::cout<<"c: "<<add(1,2)<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
all: main arithmetic
|
||||
g++ main.o arithmetic.o
|
||||
|
||||
main: main.cpp
|
||||
g++ -c main.cpp
|
||||
|
||||
arithmetic: arithmetic.cpp arithmetic.h
|
||||
g++ -c arithmetic.cpp
|
||||
|
||||
clean:
|
||||
rm *.o
|
||||
rm a.out
|
||||
Loading…
Reference in New Issue