Skip to content

Instantly share code, notes, and snippets.

@Mathias-Fuchs
Created June 12, 2020 10:10
Show Gist options
  • Save Mathias-Fuchs/909be18fb5bf6acaae7e004910afcde5 to your computer and use it in GitHub Desktop.
Save Mathias-Fuchs/909be18fb5bf6acaae7e004910afcde5 to your computer and use it in GitHub Desktop.
simple makefile for mmg test and example programs
CC = gcc
CPP = g++
INCL = -I$(HOME)/mmg/buildLinuxDebug/include/
CFLAGS += -g -Wall -Wextra -pedantic -fPIC `pkg-config --cflags cairo` -DWITHCAIRO -D_DEBUG -DEXTRADEBUG
CPPFLAGS += -g -Wall -Wextra -pedantic -fPIC `pkg-config --cflags cairo` -DWITHCAIRO -D_DEBUG -DEXTRADEBUG --std=c++17
LDFLAGS += -L$(HOME)/mmg/buildLinuxDebug/lib/ -Wl,-rpath=$(HOME)/mmg/buildLinuxDebug/lib -lmmg -lcairo -lm
main.o: main.c
$(CC) $(CFLAGS) $(INCL) -c -o $@ $<
mainpp.o: main.cpp
$(CPP) $(CPPFLAGS) $(INCL) -c -o $@ $<
main: main.o
$(CC) $^ -o $@ $(LDFLAGS)
mainpp: mainpp.o
$(CPP) $^ -o $@ $(LDFLAGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment