Skip to content

Instantly share code, notes, and snippets.

@MatyasKriz
Created February 28, 2018 11:35
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/fe26984b6f058dde0b26580d5f346a23 to your computer and use it in GitHub Desktop.
Save MatyasKriz/fe26984b6f058dde0b26580d5f346a23 to your computer and use it in GitHub Desktop.
Nezapomente v `globals.h` nahradit `#include "SDL.h"` retezcem `#include <SDL.h>`
################################################################################
# IZG project, framework compilation
################################################################################
################################################################################
# promenne prekladu
CC = g++
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
# REMOVE = del
REMOVE = rm -f
BIN = izg_lab_02.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_02
endif
#CFLAGS = -m32 -g3 -Wall $(INCS) -Wno-unused-function -fmessage-length=0
#CFLAGS = -m64 -g3 -Wall $(INCS) -Wno-unused-function -fmessage-length=0
################################################################################
# obecny cil kompilace
all: $(BIN)
################################################################################
# linkovani vysledneho souboru
$(BIN): main.o student.o io.o color.o
$(CC) main.o student.o io.o color.o -o $(BIN) $(LIBS)
# strip $(BIN)
################################################################################
# kompilace hlavniho souboru
main.o: main.cpp
$(CC) -c main.cpp -o main.o $(CFLAGS)
################################################################################
# kompilace studentskeho souboru
student.o: student.cpp student.h
$(CC) -c student.cpp -o student.o $(CFLAGS)
################################################################################
# kompilace dilcich souboru
io.o: io.cpp io.h
$(CC) -c io.cpp -o io.o $(CFLAGS)
color.o: color.cpp color.h
$(CC) -c color.cpp -o color.o $(CFLAGS)
################################################################################
# cil vycisteni souboru prekladu
clean: clear
clear:
$(REMOVE) *.o $(BIN)
################################################################################
################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment