diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e88087 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +fork +execlp diff --git a/Makefile b/Makefile index 251f4e0..e1ec215 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for base example # include ./make.h - + # 目标和源文件 TARGETS = fork execlp @@ -10,7 +10,7 @@ SOURCES = $(wildcard $(SRC_DIR)/*.c) # 找到所有的 .c 文件 OBJECTS = $(patsubst $(SRC_DIR)/%.c,%.o,$(SOURCES)) # 将 .c 替换为 .o # 默认目标 -all: $(TARGETS) +all: $(TARGETS) # 链接目标文件生成可执行文件 fork: fork.o diff --git a/make.h b/make.h index 3fa0574..b9fa4c7 100644 --- a/make.h +++ b/make.h @@ -12,7 +12,7 @@ ############################################################## -BASE_DIR = $(pwd) +BASE_DIR = $(shell pwd) TARGET_OS = OS_PTHREADS ########################## @@ -34,7 +34,7 @@ COMMON_INCLUDE_DIRS = \ ifeq (${TARGET_OS}, OS_TMO) CC_DEBUG_FLAGS = -g -CC_OPTIMIZATION_FLAGS = -O2 +CC_OPTIMIZATION_FLAGS = -O2 CC_WARNING_FLAGS = -ansi \ -Wall \ -Wunused \ @@ -120,8 +120,8 @@ LD = ldppc LD_FLAGS = -r AR = arppc AR_FLAGS = -r -#MKDIR = mkdir -#MKDIR_FLAGS = -p +MKDIR = mkdir +MKDIR_FLAGS = -p RM = rm RM_FLAGS = -f GENERAL_COMPILATION_SWITCHES = -DINCLUDE_IN_OSS \ diff --git a/src/execlp.c b/src/execlp.c index f9acbac..8f077bf 100644 --- a/src/execlp.c +++ b/src/execlp.c @@ -1,7 +1,7 @@ #include #include #include - +#include int main(int argc, char * argv[]) {