Skip to content

Instantly share code, notes, and snippets.

@Sleepful
Last active September 6, 2018 05:25
Show Gist options
  • Save Sleepful/5edda603d9aa733704984e68a532e23b to your computer and use it in GitHub Desktop.
Save Sleepful/5edda603d9aa733704984e68a532e23b to your computer and use it in GitHub Desktop.
# change application name here (executable output name)
TARGET=knapsack
# compiler
CC=gcc
# debug
DEBUG=-g
# optimisation
OPT=-O0
# warnings
WARN=-Wall
PTHREAD=-pthread
CCFLAGS=$(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipe
GTKLIB=`pkg-config --cflags --libs gtk+-3.0`
# linker
LD=gcc
LDFLAGS=$(PTHREAD) $(GTKLIB) -export-dynamic -lm
OBJS= main.o
all: $(OBJS) src/mochila.c src/mochila.h src/guardarycargar.h src/guardarycargar.c
$(LD) -o $(TARGET) $(OBJS) src/mochila.c src/guardarycargar.c $(LDFLAGS)
main.o: src/main.c
$(CC) -c $(CCFLAGS) src/main.c $(GTKLIB) -o main.o
clean:
rm -f *.o $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment