need some help with a makefile
Posted: Mon Nov 01, 2010 9:06 pm
I just started learning how to make makefiles, and am wondering how to move the .o files to their own folder to make everything neater. Below is my working makefile, any ideas?
#edit I sorta solved it by using the mv command.
Code: Select all
CC=gcc
CFLAGS=-I -lSDL -lSDL_image -lSDL_mixer -lGLU -Wall
DEPS = piece.h engine.h include.h
OBJ = main.o piece.o engine.o include.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
build: $(OBJ)
gcc -o $@ $^ $(CFLAGS)
#edit mv main.o engine.o include.o piece.o obj