Skip to content

Commit

Permalink
Makefile: partial cleanup of versioning code centered around version.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jeras authored and Iztok Jeras committed Jan 4, 2017
1 parent 57e9d17 commit 4a2d919
Show file tree
Hide file tree
Showing 32 changed files with 42 additions and 387 deletions.
12 changes: 3 additions & 9 deletions Test/acquire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ SRCS = $(subst .o,.c, $(OBJS)))
TARGET=acquire

# GCC compiling & linking flags
CFLAGS=-g -std=gnu99 -Wall -Werror
CFLAGS = -g -std=gnu99 -Wall -Werror
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBS=-lm -lpthread
Expand Down Expand Up @@ -61,18 +59,14 @@ all: $(TARGET)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from $(TARGET)
# list.
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(TARGET) *.o
Expand Down
2 changes: 1 addition & 1 deletion Test/acquire/acquire.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "main_osc.h"
#include "fpga_osc.h"
#include "version.h"
#include "redpitaya/version.h"

/**
* GENERAL DESCRIPTION:
Expand Down
12 changes: 3 additions & 9 deletions Test/bode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ SRCS = $(subst .o,.c, $(OBJS)))
TARGET=bode

# GCC compiling & linking flags
CFLAGS=-g -std=gnu99 -Wall -Werror
CFLAGS = -g -std=gnu99 -Wall -Werror
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBS=-lm -lpthread
Expand Down Expand Up @@ -61,18 +59,14 @@ all: $(TARGET)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from $(TARGET)
# list.
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(TARGET) *.o
Expand Down
2 changes: 1 addition & 1 deletion Test/bode/acquire.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "main_osc.h"
#include "fpga_osc.h"
#include "version.h"
#include "redpitaya/version.h"

/**
* GENERAL DESCRIPTION:
Expand Down
2 changes: 1 addition & 1 deletion Test/bode/bode.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "main_osc.h"
#include "fpga_osc.h"
#include "fpga_awg.h"
#include "version.h"
#include "redpitaya/version.h"

#define M_PI 3.14159265358979323846

Expand Down
34 changes: 0 additions & 34 deletions Test/bode/version.h

This file was deleted.

12 changes: 3 additions & 9 deletions Test/calib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ SRCS = $(subst .o,.c, $(OBJS)))
TARGET=calib

# GCC compiling & linking flags
CFLAGS=-g -std=gnu99 -Wall -Werror
CFLAGS = -g -std=gnu99 -Wall -Werror
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBS=
Expand Down Expand Up @@ -62,18 +60,14 @@ all: $(TARGET)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from $(TARGET)
# list.
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(TARGET) *.o
Expand Down
2 changes: 1 addition & 1 deletion Test/calib/calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sys/param.h>

#include "rp_eeprom.h"
#include "version.h"
#include "redpitaya/version.h"


/** Minimal number of command line arguments */
Expand Down
12 changes: 3 additions & 9 deletions Test/calibrate/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ CALIBRATE2=calibrateApp2
CALIBTUNE=calibTune

# GCC compiling & linking flags
CFLAGS =-g -std=gnu99 -Wall -Werror -I../../api/include
CFLAGS = -g -std=gnu99 -Wall -Werror -I../../api/include
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBPATH= -L../../api/lib
Expand All @@ -51,7 +49,7 @@ all: $(TARGET) $(CALIBRATE2)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from list.
Expand All @@ -64,10 +62,6 @@ $(CALIBRATE2):
$(CALIBTUNE):
$(CC) $(CFLAGS) $(LIBPATH) $(LIBS) -o $@ $(CALIBTUNE_C)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(CALIBRATE) $(CALIBRATE2) $(CALIBTUNE) *.o
Expand Down
34 changes: 0 additions & 34 deletions Test/calibrate/version.h

This file was deleted.

12 changes: 3 additions & 9 deletions Test/discovery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ DISCOVERY_C = discovery.c
TARGET=discovery

# GCC compiling & linking flags
CFLAGS =-g -std=c++11 -Wall -I../../api/include
CFLAGS = -g -std=c++11 -Wall -I../../api/include
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBPATH=
Expand All @@ -47,18 +45,14 @@ all: $(TARGET)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from list.

$(TARGET):
$(CC) -o $@ $(DISCOVERY_C) $(CFLAGS) $(LIBPATH) $(LIBS)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(TARGET) *.o
Expand Down
34 changes: 0 additions & 34 deletions Test/discovery/version.h

This file was deleted.

12 changes: 3 additions & 9 deletions Test/generate/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ SRCS = $(subst .o,.c, $(OBJS)))
TARGET=generate

# GCC compiling & linking flags
CFLAGS=-g -std=gnu99 -Wall -Werror
CFLAGS = -g -std=gnu99 -Wall -Werror
CFLAGS += -I../../api/include
CFLAGS += -DVERSION=$(VERSION) -DREVISION=$(REVISION)

# Red Pitaya common SW directory
SHARED=../../shared/

# Additional libraries which needs to be dynamically linked to the executable
# -lm - System math library (used by cos(), sin(), sqrt(), ... functions)
LIBS=-lm
Expand Down Expand Up @@ -61,18 +59,14 @@ all: $(TARGET)
# It applies to all files ending with .o. During partial building only new object
# files are created for the source files (.c) which have newer timestamp then
# objects (.o) files.
%.o: %.c version.h
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

# Makefile target with rules how to link executable for each target from $(TARGET)
# list.
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

# Version header for traceability
version.h:
cp $(SHARED)/include/redpitaya/version.h .

# Clean target - when called it cleans all object files and executables.
clean:
rm -f $(TARGET) *.o
Expand Down
2 changes: 1 addition & 1 deletion Test/generate/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string.h>

#include "fpga_awg.h"
#include "version.h"
#include "redpitaya/version.h"

/**
* GENERAL DESCRIPTION:
Expand Down
34 changes: 0 additions & 34 deletions Test/generate/version.h

This file was deleted.

Loading

0 comments on commit 4a2d919

Please sign in to comment.