ipc/Makefile

54 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

2023-12-26 11:01:23 +00:00
# Copyright (C) 2023 The Trinitrix Project <soispha@vhack.eu, antifallobst@systemausfall.org>
#
# This file is part of the RPC crate for Trinitrix.
#
# RPC is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
2023-12-26 11:00:08 +00:00
PREFIX := /usr/local
BINPREFIX := $(DESTDIR)$(PREFIX)/bin
MANPREFIX := $(DESTDIR)$(PREFIX)/share/man/man1
BIN_NAME := ./target/main
2023-12-26 11:00:08 +00:00
SRC := $(wildcard c_src/*.c)
OBJ := $(SRC:.c=.o)
DEP := $(OBJ:.o=.d)
LIBS := rpc
ALL_CFLAGS := -O3 -MMD -Wall -Wextra -Wno-unused-parameter $(CFLAGS) $(CPPFLAGS)
ALL_LDFLAGS := $(addprefix -l,$(LIBS)) -L $(LD_LIBRARY_PATH) $(CFLAGS) $(LDFLAGS)
2023-12-26 11:00:08 +00:00
$(BIN_NAME): $(OBJ)
$(CC) -o $@ $+ $(ALL_LDFLAGS)
.c.o:
$(CC) -o $@ $< -c $(ALL_CFLAGS)
.PHONY : clean options
options:
@echo "CC = $(CC)"
@echo "CFLAGS = $(ALL_CFLAGS)"
@echo "LDFLAGS = $(ALL_LDFLAGS)"
@echo "SRC = $(SRC)"
@echo "OBJ = $(OBJ)"
@echo "DEP = $(DEP)"
@echo ""
clean :
rm $(BIN_NAME) $(OBJ) $(DEP)