This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
ics_cli/src/Makefile

43 lines
801 B
Makefile
Raw Normal View History

CC = gcc
CFLAGS = -Wall -g -O0
LDFLAGS = -luuid
2023-08-25 10:44:15 +02:00
# List of all source files (assuming they're all in the same directory)
SRC_FILES = $(wildcard *.c)
2023-08-25 10:44:15 +02:00
# Generate a list of object files by replacing the .c extension with .o
OBJ_FILES = $(SRC_FILES:.c=.o)
EXECUTABLE = "icscli"
# linking
$(EXECUTABLE): $(OBJ_FILES)
2024-07-09 08:32:32 +02:00
$(CC) $(CFLAGS) $(OBJ_FILES) -o $(EXECUTABLE) $(LDFLAGS)
main.o: main.c
$(CC) $(CFLAGS) -c $<
# use implicit rule to compile C source files to object files
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
2023-08-25 10:44:15 +02:00
.PHONY:install
install: $(EXECUTABLE)
cp $(EXECUTABLE) /usr/local/bin/$(EXECUTABLE)
2023-08-25 10:44:15 +02:00
.PHONY:clean
clean:
-rm -vf $(EXECUTABLE) *.o
2023-08-25 10:44:15 +02:00
.PHONY:uninstall
uninstall:
-rm /usr/local/bin/$(EXECUTABLE)
2023-08-25 10:44:15 +02:00
.PHONY:test
test:
./$(EXECUTABLE)
2023-08-25 10:44:15 +02:00
@echo
./$(EXECUTABLE) -h
2023-08-25 10:44:15 +02:00
@echo
../tests/run_tests.sh