Skip to content

Commit 87698cc

Browse files
jar3mrama2092
andauthored
Logger management (#7)
* created logger management * Makefile disabled ds in clean added rules for logger definition Co-authored-by: rama2092 <[email protected]>
1 parent 8e3b2a6 commit 87698cc

7 files changed

Lines changed: 22 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ $(test_ARCHIVE) :
5555
.PHONY: clean help
5656

5757
clean:
58-
make -C ds/ clean
5958
make -C test/ clean
59+
# make -C ds/ clean
6060
find ${PROJ_PATH} -name "*.[ao]" -exec rm -v {} \;
6161

6262

common/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ common_OBJ=bin/common.o
44

55
common_ARCHIVE=$(PROJ_PATH)/common/bin/common.a
66

7+
logger_SRC=src/logger.c
8+
logger_OBJ=bin/logger.o
9+
10+
common_ARCHIVE=$(PROJ_PATH)/common/bin/common.a
11+
712
OBJS=$(common_OBJ)
13+
OBJS+=$(logger_OBJ)
814

915
$(common_OBJ): $(common_SRC)
1016
$(CC) $(INCLUDES) -c $^ -o $@ $(CFLAGS)
1117

18+
$(logger_OBJ): $(logger_SRC)
19+
$(CC) $(INCLUDES) -c $^ -o $@ $(CFLAGS)
20+
1221
all: $(OBJS)
1322
@echo "building common"
1423
ar rcs $(common_ARCHIVE) $(OBJS)
24+
rm -f $(OBJS)
1525

1626

1727
.PHONY: clean

common/inc/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#include "os.h"
22
#include "typedefs.h"
3+
#include "logger.h"
34

common/inc/logger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
void logger_init();

common/src/logger.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "common.h"
2+
3+
void logger_init()
4+
{
5+
printf("Logger init\n");
6+
}

test/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $(test_OBJ): $(test_SRC)
1717

1818
all: $(OBJS)
1919
ar rcs $(test_ARCHIVE) $(OBJS)
20+
rm -f $(OBJS)
2021

2122

2223
.PHONY: clean

test/src/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
int main(int argc, char *argv[])
55
{
66
printf("Hello World\n");
7-
7+
logger_init();
88
return 0;
99
}

0 commit comments

Comments
 (0)