# HG changeset patch # User Masataka Kohagura # Date 1444209692 -32400 # Node ID 3d1c71fbd4a4d207cc8dddb0b14276303a8367cb # Parent d19afac949a56fbb7b65a4c8f581a1c9509d1b75 add bitInfo & fix Makefile diff -r d19afac949a5 -r 3d1c71fbd4a4 c/bitVector/Makefile --- a/c/bitVector/Makefile Wed Oct 07 18:17:56 2015 +0900 +++ b/c/bitVector/Makefile Wed Oct 07 18:21:32 2015 +0900 @@ -1,12 +1,27 @@ TARGET= bitVector -OPTION= -Wall -O0 -g +CFLAGS= -Wall -O0 -g +CC= clang++ + +SRCS_TMP = $(wildcard *.cc) +SRCS_EXCLUDE = # 除外するファイルを書く +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +.SUFFIXES: .cc .o -$(TARGET):main.cc - clang $(OPTION) -o $(TARGET) main.cc +.cc.o: + $(CC) $(CFLAGS) -c $< -o $@ + +all: $(TARGET) + +$(TARGET):$(OBJS) + $(CC) -o $@ $(OBJS) + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) clean: - rm -f $(TARGET) - rm -r $(TARGET).dSYM + rm -f $(TARGET) $(OBJS) rm -f *~ \#* test: diff -r d19afac949a5 -r 3d1c71fbd4a4 c/bitVector/bitInfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/bitVector/bitInfo.h Wed Oct 07 18:21:32 2015 +0900 @@ -0,0 +1,4 @@ +typedef struct bitInfo { + int arrayNum; + unsigned long *bitContainer; +}BitInfo,*BitInfoPtr; diff -r d19afac949a5 -r 3d1c71fbd4a4 c/bitVector/main.cc --- a/c/bitVector/main.cc Wed Oct 07 18:17:56 2015 +0900 +++ b/c/bitVector/main.cc Wed Oct 07 18:21:32 2015 +0900 @@ -1,14 +1,10 @@ #include #include #include +#include "bitInfo.h" int bitBlock = sizeof(unsigned long) * 8; -typedef struct bitInfo { - int arrayNum; - unsigned long *bitContainer; -}BitInfo,*BitInfoPtr; - void bitSet(BitInfoPtr bi, int bitSetPosition) { unsigned long tmp = 1;