46 lines
1.2 KiB
Makefile
46 lines
1.2 KiB
Makefile
#
|
|
# Makefile
|
|
#
|
|
# Copyright 2025
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 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
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
# MA 02110-1301, USA.
|
|
#
|
|
#
|
|
|
|
CC=gcc
|
|
OPTIONS=-O2 -Wall -ansi
|
|
OUTPUT_NAME=microconf
|
|
COPY=cp
|
|
INPUT_NAME=example.c
|
|
REMOVE=rm
|
|
INSTALL_NAME=/usr/local/bin/microconf-example
|
|
MODE=chmod +x
|
|
RUN_OF=./
|
|
|
|
.PHONY: clear run install uninstall
|
|
|
|
$(OUTPUT_NAME): $(INPUT_NAME)
|
|
$(CC) $(OPTIONS) $(INPUT_NAME) -o $(OUTPUT_NAME)
|
|
clear:
|
|
$(REMOVE) -f $(OUTPUT_NAME)
|
|
run:
|
|
$(MODE) $(OUTPUT_NAME)
|
|
$(RUN_OF)$(OUTPUT_NAME)
|
|
install:
|
|
$(COPY) $(OUTPUT_NAME) $(INSTALL_NAME)
|
|
uninstall:
|
|
$(REMOVE) $(INSTALL_NAME)
|