Skeleton project initial code

This commit is contained in:
Stephen Seo 2024-08-29 14:19:46 +09:00
commit 1a8f81f84f
3 changed files with 36 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/c_simple_http
/objs/

29
Makefile Normal file
View file

@ -0,0 +1,29 @@
COMMON_FLAGS = -Wall -Wextra -Wpedantic
DEBUG_FLAGS = -Og
RELEASE_FLAGS = -O3 -DNDEBUG
ifdef RELEASE
CFLAGS = ${COMMON_FLAGS} ${RELEASE_FLAGS}
else
CFLAGS = ${COMMON_FLAGS} ${DEBUG_FLAGS}
endif
SOURCES = \
src/main.c
OBJECT_DIR = objs
OBJECTS = $(addprefix ${OBJECT_DIR}/,$(patsubst %.c,%.c.o,${SOURCES}))
all: c_simple_http
c_simple_http: ${OBJECTS}
gcc -o c_simple_http ${CFLAGS} $^
.PHONY: clean
clean:
rm -f c_simple_http
rm -rf ${OBJECT_DIR}
${OBJECT_DIR}/%.c.o: %.c
@mkdir -p $(dir $@)
gcc -o $@ -c ${CFLAGS} $<

5
src/main.c Normal file
View file

@ -0,0 +1,5 @@
int main(int argc, char **argv) {
return 0;
}
// vim: ts=2 sts=2 sw=2