# Copyright (C) 2023 The Trinitrix Project # # 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 . PREFIX := /usr/local BINPREFIX := $(DESTDIR)$(PREFIX)/bin MANPREFIX := $(DESTDIR)$(PREFIX)/share/man/man1 BIN_NAME := main SRC := $(wildcard c_src/*.c) OBJ := $(SRC:.c=.o) DEP := $(OBJ:.o=.d) LIBS := rpc ALL_CFLAGS := -fPIC -O3 -MMD -Wall -Wextra -Wno-unused-parameter $(CFLAGS) $(CPPFLAGS) ALL_LDFLAGS := -shared $(addprefix -l,$(LIBS)) -L $(LD_LIBRARY_PATH) $(CFLAGS) $(LDFLAGS) $(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)