Skip to content

Instantly share code, notes, and snippets.

@MatyasKriz
Last active March 26, 2018 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatyasKriz/64009f82830327d75a7aae4897214f6b to your computer and use it in GitHub Desktop.
Save MatyasKriz/64009f82830327d75a7aae4897214f6b to your computer and use it in GitHub Desktop.
Makefile pro cviceni v IZG #4.
################################################################################
# IZG project, framework compilation
################################################################################
################################################################################
# promenne prekladu
CFLAGS += -g3 -Wall $(INCS) -Wno-unused-function -fmessage-length=0
ifeq ($(OS), Windows_NT)
INCS = -I../SDL-1.2.15/include -IQ:/mingw/SDL/SDL
LIBS = -lmingw32 -lSDLmain -lSDL -L../SDL-1.2.15/lib -LQ:/mingw/SDL
CFLAGS = -m32
REMOVE = del
BIN = izg_lab_04.exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
LIBS = -lSDL
endif
ifeq ($(UNAME_S), Darwin)
LIBS = `sdl-config --libs`
CFLAGS += `sdl-config --cflags`
endif
INCS = -I/usr/include/SDL
# LIBS=-m32 -lSDL
# LIBS=-m64 -lSDL
REMOVE = rm -f
BIN = izg_lab_04
endif
CC = g++
#CFLAGS = -m32 -g3 -Wall $(INCS) -Wno-unused-function -fmessage-length=0
#CFLAGS = -m64 -g3 -Wall $(INCS) -Wno-unused-function -fmessage-length=0
################################################################################
# vyjmenovane obj soubory pro uziti implicitniho pravidla kompilace/linkovani
OBJ = main.o student.o vector.o color.o
%.o : %.cpp
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
################################################################################
# obecny cil kompilace
all: $(BIN)
################################################################################
# kompilace a linkovani vysledneho souboru
$(BIN): $(OBJ)
$(CC) $(OBJ) -o $(BIN) $(LIBS) -lm
################################################################################
# cil vycisteni souboru prekladu
clean: clear
clear:
$(REMOVE) $(OBJ) $(BIN)
################################################################################
################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment