added t1 t2 and readme

This commit is contained in:
2020-05-17 12:16:22 +02:00
committed by GitHub
parent 77d02fc093
commit 778bbe1ff2
16 changed files with 117 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
void myPrintHelloMake(void);
+9
View File
@@ -0,0 +1,9 @@
#include <stdio.h>
#include <hellomake.h>
void myPrintHelloMake(void) {
printf("Hello makefiles!\n");
return;
}
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
#include <hellomake.h>
int main() {
// call a function in another file
myPrintHelloMake();
return(0);
}
+26
View File
@@ -0,0 +1,26 @@
IDIR =../include
CC=gcc
CFLAGS=-I$(IDIR)
ODIR=obj
LDIR =../lib
LIBS=-lm
_DEPS = hellomake.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = hellomake.o hellofunc.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
$(ODIR)/%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
hellomake: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~
Binary file not shown.
Binary file not shown.