By simply following the pattern of tones and semitones, it is possible to construct a major scale starting on any note. The scale will be named by the note it starts on. Play the following major scales in the first position and name each note out loud as you play it. Once you can do this, move each one to as many different places on the fretboard as possible.
Now that you know how major scales are constructed, try writing out and playing major scales built on the notes A, B, F#, Db and Gb. Some will contain sharps, while others will contain flats. Remember that the scale is named from its starting note and all you have to do is follow the pattern of tones and semitones.