From 02c1ddcae6c88b55d2f4de825ee6c6456150b8ae Mon Sep 17 00:00:00 2001 From: solar Date: Sun, 20 Nov 2005 13:04:16 +0000 Subject: [PATCH] Added Makefile and moved internal headers into seperate directory (allowing easier _partial_ compilation of PDCLib). --- Makefile | 28 ++++++++++++++++++++++++ functions/string/memcpy.c | 1 + functions/string/strncat.c | 1 + functions/string/strncpy.c | 1 + functions/string/strtok.c | 1 + functions/string/strxfrm.c | 1 + {includes => internals}/_PDCLIB_aux.h | 0 {includes => internals}/_PDCLIB_config.h | 0 {includes => internals}/_PDCLIB_int.h | 0 9 files changed, 33 insertions(+) create mode 100644 Makefile rename {includes => internals}/_PDCLIB_aux.h (100%) rename {includes => internals}/_PDCLIB_config.h (100%) rename {includes => internals}/_PDCLIB_int.h (100%) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9358097 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# This is a list of all non-source files that are part of the distribution. +AUXFILES := Makefile Readme.txt + +SRCFILES := $(shell find . -name "*.c" -mindepth 1 -maxdepth 3) +HDRFILES := $(shell find . -name "*.h" -mindepth 1 -maxdepth 3) +OBJFILES := $(patsubst %.c,%.o,$(SRCFILES)) +DEPFILES := $(patsubst %.c,%.d,$(SRCFILES)) +ALLFILES := $(SRCFILES) $(HDRFILES) $(AUXFILES) + +CPPFLAGS := -MMD -MP +CFLAGS := -g -std=c99 -I./internals/ + +.PHONY: all clean dist + +all: $(OBJFILES) + ar r pdclib.a $(OBJFILES) + +-include $(DEPFILES) + +clean: + -@for file in $(OBJFILES) $(DEPFILES) pdclib.a; do if [ -f $$file ]; then rm $$file; fi; done + +dist: + @tar czf pdclib.tgz $(ALLFILES) + +%.o: %.c Makefile + $(CC) $(MODE) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + diff --git a/functions/string/memcpy.c b/functions/string/memcpy.c index 785b1cd..a5842d3 100644 --- a/functions/string/memcpy.c +++ b/functions/string/memcpy.c @@ -8,6 +8,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#include <_PDCLIB_aux.h> #include void * memcpy( void * _PDCLIB_restrict s1, const void * _PDCLIB_restrict s2, size_t n ) diff --git a/functions/string/strncat.c b/functions/string/strncat.c index b33fb7c..44dcb40 100644 --- a/functions/string/strncat.c +++ b/functions/string/strncat.c @@ -8,6 +8,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#include <_PDCLIB_aux.h> #include char * strncat( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n ) diff --git a/functions/string/strncpy.c b/functions/string/strncpy.c index aafb704..ed5965d 100644 --- a/functions/string/strncpy.c +++ b/functions/string/strncpy.c @@ -8,6 +8,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#include <_PDCLIB_aux.h> #include char * strncpy( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n ) diff --git a/functions/string/strtok.c b/functions/string/strtok.c index 4d371af..3135920 100644 --- a/functions/string/strtok.c +++ b/functions/string/strtok.c @@ -8,6 +8,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#include <_PDCLIB_aux.h> #include char * strtok( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2 ) diff --git a/functions/string/strxfrm.c b/functions/string/strxfrm.c index 578eb4b..5849a0c 100644 --- a/functions/string/strxfrm.c +++ b/functions/string/strxfrm.c @@ -8,6 +8,7 @@ Permission is granted to use, modify, and / or redistribute at will. */ +#include <_PDCLIB_aux.h> #include /* TODO: Dummy function, no locale support yet. */ diff --git a/includes/_PDCLIB_aux.h b/internals/_PDCLIB_aux.h similarity index 100% rename from includes/_PDCLIB_aux.h rename to internals/_PDCLIB_aux.h diff --git a/includes/_PDCLIB_config.h b/internals/_PDCLIB_config.h similarity index 100% rename from includes/_PDCLIB_config.h rename to internals/_PDCLIB_config.h diff --git a/includes/_PDCLIB_int.h b/internals/_PDCLIB_int.h similarity index 100% rename from includes/_PDCLIB_int.h rename to internals/_PDCLIB_int.h -- 2.40.0