diff --git a/extern/Makefile b/extern/Makefile new file mode 100644 index 0000000..49ff7ba --- /dev/null +++ b/extern/Makefile @@ -0,0 +1,22 @@ +CC = gcc +CFLAGS = -Wall -MMD +LDFLAGS = -lm +SRCS = $(wildcard *.c) +OBJS = $(SRCS:.c=.o) +DEPS = $(OBJS:.o=.d) +TARGET = a.out + +all: $(TARGET) + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +-include $(DEPS) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) + +clean: + rm -f $(OBJS) $(DEPS) $(TARGET) + + diff --git a/extern/p.c b/extern/p.c index 9a3a353..fce8568 100644 --- a/extern/p.c +++ b/extern/p.c @@ -1,8 +1,8 @@ // gcc p.c q.c -lm でビルド // ./a.out で実行 -#include "q.h" #include +#include "q.h" int main(){ float d = 1.23;