For linux you just need a makefile and type "make":
CC = gcc
CFLAGS = -O2
INCPATH = -I.
LINK = g++
LIBS = -lglfw -lGLU -lGL -lXrandr
SOURCES = gl2d.c main.c
OBJECTS = $(SOURCES:.c=.o)
TARGET = gl2d
all: $(TARGET)
# build binary by linking all object-files and libraries
$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) $(OBJECTS) $(LIBS) -o $@
# build each object-file by compiling the corresponding source-file
.o:
$(CC) $(CFLAGS) $(INCPATH) $< -o $@
# delete all objects and binary
clean:
rm -rf $(TARGET) $(OBJECTS)
(remember to keep the tabs)