Makefile basic_sin, basic_sin2

CC = c++ CFLAGS = -I/usr/local/include/ LDLIBS = -L/usr/local/lib/ LDFLAGS = -lSDL2 all: basic_sin basic_sin2 basic_sin: basic_sin.o $(CC) -o $@ basic_sin.o $(LDLIBS) $(LDFLAGS) basic_sin.o: basic_sin.cc $(CC) -c $(CFLAGS) $< basic_sin2: basic_sin2.o $(CC) -o $@ basic_sin2.o $(LDLIBS) $(LDFLAGS) basic_sin2.o: basic_sin2.cc $(CC) -c $(CFLAGS) $< .PHONY: clean cleanest clean: rm *.o cleannest: clean rm basic_sin
Makefile to compile the basic_sin and basic_sin2 examples. It should work as is on FreeBSD and Linux. If it doesn't work for Linux just change:
CC = c++
to
CC = g++

To compile both examples just type
make
or
make all

You should be able to type:
make basic_sin
or
make basic_sin2

to compile just a single example.

This is just a simple Makefile for reference to myself. It's not perfect and probably not very scalable, but works for me.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.