adds my generic makefile
This commit is contained in:
parent
d97b819ff0
commit
b3c0f957bc
24
GNUMake/Makefile
Normal file
24
GNUMake/Makefile
Normal file
@ -0,0 +1,24 @@
|
||||
CC=gcc
|
||||
CFLAGS= -c -g -Wall
|
||||
|
||||
#LDLIBS = # -lcurl -lssl ...
|
||||
|
||||
#TARGET :=
|
||||
|
||||
BUILD_DIR := ./build
|
||||
SRC_DIRS := ./src
|
||||
|
||||
SRCS := $(shell find $(SRC_DIRS) -name '*.c')
|
||||
|
||||
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
|
||||
|
||||
$(BUILD_DIR)/$(TARGET): $(OBJS)
|
||||
$(CC) $(OBJS) -o $@ $(LDLIBS)
|
||||
|
||||
$(BUILD_DIR)/%.c.o: %.c
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
Loading…
x
Reference in New Issue
Block a user