Skip to content

Instantly share code, notes, and snippets.

@Arkni

Arkni/makefile Secret

Created March 24, 2017 22:28
Show Gist options
  • Save Arkni/4404e4657c4140790cd12f8a2422261a to your computer and use it in GitHub Desktop.
Save Arkni/4404e4657c4140790cd12f8a2422261a to your computer and use it in GitHub Desktop.
TARGET=silentcast
OBJS= main.o SC_X11_get_active_window.o SC_conf_widgets.o
CC=gcc
DEBUG=-g
OPT=-O0
WARN=-Wall
VERS=-std=gnu99
vpath %.c lib:src
PTHREAD=-pthread
CCFLAGS=$(VERS) $(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipe
GTKX11LIB = `pkg-config --cflags --libs x11 gtk+-x11-3.0`
SCLIB = -I./lib
# linker
LD=gcc
LDFLAGS=$(PTHREAD) $(GTKX11LIB) -export-dynamic -lm
all: $(OBJS)
$(LD) -o $(TARGET) $(OBJS) $(LDFLAGS)
%.o: %.c
$(CC) -c $(CCFLAGS) $< $(GTKX11LIB) -o $@ $(SCLIB)
clean:
rm -f *.o $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment