Advertisement
Matthuwee

Untitled

May 24th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.02 KB | None | 0 0
  1. # list of all executables that need to be compiled, you should have .c files with these names
  2. EXE = main
  3. # compiler command
  4. CC = gcc
  5. # all shared libraries will be copied in this directory
  6. LDIR = lib
  7. # all intermediate files (e.g. .o files) will be located in this folder
  8. TMPDIR = tmp
  9. # basic gcc flags for compiling executables
  10. CFLAGS = -Wall -c -std=c99 $$(mysql_config --cflags --libs)
  11. LFLAGS = -L./$(LDIR) -Wl,-rpath=./$(LDIR)
  12. # basic gcc flags for compiling shared libraries
  13. CDFLAGS = -Wall -c -std=c99 -fPIC -o $(TMPDIR)/$@ $< $$(mysql_config --cflags --libs)
  14. # basic gcc flags for linking shared libraries
  15. LDFLAGS = -shared -o $(LDIR)/$@ $(TMPDIR)/$<
  16.  
  17. # Main target when executing make. Compile all files listed in the EXE variable
  18. all: main.c myqueue.c tcpsocket.c sensor_db.c datamgr.c
  19.     $(CC) -pthread -std=c99 main.c myqueue.c tcpsocket.c sensor_db.c datamgr.c -DSET_MAX_TEMP=14 -DSET_MIN_TEMP=10 -llist -L./lib -Wl,-rpath=./lib $(mysql_config --cflags --libs) -o $(EXE)
  20.     ./$(EXE)
  21.  
  22.  
  23. clean:
  24.     rm -f *~ *.o $(EXE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement