O PROGRAMA_A USA A libL.a VINCULADA ESTATICAMENTE (VIDE MAKEFILE'S ABAIXO). GOSTARIA DE INCLUIR AS CURL, CJSON, SSL E CRYPTO À libL.a E EXCLUÍ-LAS DO PROGRAMA_A. PODERIAM ME ORIENTAR QUAIS AS MUDANÇAS DEVEM SER FEITAS NOS DOIS MAKEFILE'S? GRATO. MAKEFILE DA libL.a
CC = gcc
CFLAGS = -Wall -Iinclude # Assumindo que os headers estÆo em L/include
SRC_DIR = src
OBJ_DIR = obj
LIB_DIR = .
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRC))
LIBRARY = $(LIB_DIR)/libL.a
all: $(LIBRARY)
$(LIBRARY): $(OBJ)
ar rcs $@ $^
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)/*.o $(LIBRARY)
.PHONY: all clean
MAKEFILE DO PROGRAMA_A
CC = gcc
CFLAGS += -Wall -Iheader -IL/include # Inclua o caminho para os headers da biblioteca L
CFLAGS += -I/usr/include/openssl
CFLAGS += -DBUILD_DATE=\"$(shell date +'%Y%m%d%H%M%S')\"
LDFLAGS = -lcurl -lcjson -lssl -lcrypto -L../L -lL # Adicione a biblioteca L.a
SRC_DIR = source
OBJ_DIR = obj
BIN_DIR = bin
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRC))
EXECUTABLE = $(BIN_DIR)/PROGRAMA_A
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJ) ../L/libL.a # Adicione a dependˆncia da biblioteca
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)/*.o $(EXECUTABLE)
.PHONY: all clean