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

9
trial2/src/hellofunc.c Normal file
View File

@@ -0,0 +1,9 @@
#include <stdio.h>
#include <hellomake.h>
void myPrintHelloMake(void) {
printf("Hello makefiles!\n");
return;
}

BIN
trial2/src/hellomake Normal file

Binary file not shown.

8
trial2/src/hellomake.c Normal file
View File

@@ -0,0 +1,8 @@
#include <hellomake.h>
int main() {
// call a function in another file
myPrintHelloMake();
return(0);
}

26
trial2/src/makefile Normal file
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)/*~

BIN
trial2/src/obj/hellofunc.o Normal file

Binary file not shown.

BIN
trial2/src/obj/hellomake.o Normal file

Binary file not shown.