Download Makefile-pgi source code

PGI=/opt/pgi/linux86-64-llvm/19.4/bin
export PATH := $(PGI):$(PATH)

CC=pgcc
CXX=pgc++
FLAGS=-g
# -acc -ta=multicore,tesla -Minfo=accel
CFLAGS=$(FLAGS)
CXXFLAGS=$(FLAGS)
LIBS=

HEADERS=$(wildcard *.h)
SOURCES=$(wildcard *.c*)
OBJECTS=$(SOURCES:.c=.o)
#OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=$(shell basename `pwd`)

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(CFLAGS) $^ -o $@ $(LIBS)

%.o: %.cpp $(HEADERS)
	$(CXX) -c $< -o $@ $(CXXFLAGS)

%.o: %.c $(HEADERS)
	$(CC) -c $(CFLAGS) $< -o $@


.PHONY: gitignore
gitignore:
	echo $(EXECUTABLE) > .gitignore

.PHONY: clean
clean:
	rm -rf $(EXECUTABLE) *.o *.dSYM *~