1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2026-08-21 13:22:54 +00:00

first commit

This commit is contained in:
jikim
2015-12-13 22:34:58 +09:00
commit 0b589c7986
9455 changed files with 4350134 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// foo.c
#include <stdio.h>
#include <mylib.h>
void foo()
{
printf("foo\n");
}
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
// goo.c
#include <stdio.h>
#include <mylib.h>
void goo()
{
printf("goo\n");
}
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
TLIB=mylib.a
OBJS=foo.o goo.o
CC=cc
INCPATH=.
CFLAGS=-Wall -I$(INCPATH)
.c.o:
$(CC) $(CFLAGS) -c $<
$(TLIB): $(OBJS)
ar cr $(TLIB) $(OBJS)
$(OBJS): $(INCPATH)/mylib.h
cleanall:
-rm -f *.o *.a
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
// mylib.h
void foo();
void goo();
Binary file not shown.
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <mylib.h>
int main (int arg, char *argv[])
{
foo();
goo();
return 0;
}
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
OBJS=main.o
CC=cc
INCLIB=../MYLIB
LIBS=$(INCLIB)/mylib.a
CFLAGS=-Wall -I. -I$(INCLIB)
.c.o:
$(CC) $(CFLAGS) -c $<
app: $(OBJS) $(LIBS)
$(CC) $(CFLAGS) -o app $(OBJS) $(LIBS)
$(OBJS): $(INCLIB)/mylib.h
cleanall:
-rm -f *.o app
+29
View File
@@ -0,0 +1,29 @@
# MYLIB 안에 makefile을 수행하고 application 안에 makefile 수행..
COND1=`stat app 2>/dev/null | grep Modify`
COND2=`stat ./application/app 2>/dev/null | grep Modify`
all: buildall getexec
buildall:
@echo "****** Invoking MYLIB/makefile"
(cd MYLIB; $(MAKE))
@echo "****** Invoking application/makefile"
(cd application; $(MAKE))
getexec:
@if [ "$(COND1)" != "$(COND2)" ];\
then\
echo "Getting new app!";\
cp -p ./application/app . 2>/dev/null;\
chmod 700 app;\
else\
echo "Nothing done!";\
fi
cleanall:
-rm -f app
@echo "****** Invoking MYLIB/makefile"
@(cd MYLIB; $(MAKE) cleanall)
@echo "****** Invoking appl/makefile"
@(cd application; $(MAKE) cleanall)