Quote:
Originally Posted by Birdman48
Good deal!
Thanks
|
You're welcome
Quote:
Originally Posted by Birdman48
BTW is there another way to do this?
Like setting the PATH or something. Will I find this in documentation of PATH environment variables and such?
|
What you could do is checking out documentation on make / Makefile's.
EDIT: A simple, still extendable, Makefile to compile prog_name from 2 source files could be:
Code:
src = src_file_1.c src_file_2.c
obj = $(src:.c=.o)
CC = gcc
CFLAGS = -O2 -Wall -Wextra `pkg-config --cflags gtk+-3.0`
LIBS = `pkg-config --libs gtk+-3.0`
all: prog_name
$(obj): $(src) Makefile
$(CC) $(CFLAGS) -c $(src)
prog_name: $(obj)
$(CC) -o prog_name $(obj) $(LIBS)
.PHONY: install
install:
sudo cp prog_name /usr/bin/
.PHONY: uninstall
uninstall:
sudo rm /usr/bin/prog_name
.PHONY: clean
clean:
rm -f $(obj) prog_name
It will then be easy to add extra source files, extra compile flags, extra libraries, ...
There is also GNU autotools but it's getting rather complicated.